No commit activity in last 3 years
No release in over 3 years
ISDColorPalette is a color selection panel for the RubyMotion iOS app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

ISDColorPalette

ISDColorPalette is a color selection panel for the RubyMotion iOS app.

Screenshot

Installation

# in Gemfile
gem 'isd-color-palette'

ISDColorPalette uses Sugarcube and BubbleWrap.

# in Gemfile
gem 'bubble-wrap'
# minimum set
gem 'sugarcube', :require => [
      'sugarcube-core',
      'sugarcube-localized',
      'sugarcube-color',
      'sugarcube-uikit',
      'sugarcube-nsuserdefaults'
    ]

Usage

# attr_accessor :color

# get a controller.
c = ISDColorPaletteViewController.colorPaletteViewController
# set an initial color.
c.selectedColor = self.color
# set a callback.
c.selected_color_block = Proc.new {|color| did_select_color color }
# push the controller.
self.navigationController.pushViewController c, animated:true

If you want to get nil instead of the clear color, set #return_nil true.

  c.return_nil = true

The selected_color_block is called after a color is selected.

def did_select_color color
  p color
  self.color = color
end

License

MIT License