Skip to content

Instantly share code, notes, and snippets.

@alessaba
Last active May 30, 2016 15:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alessaba/8877278f1d7581a6fd2a0115137d289a to your computer and use it in GitHub Desktop.
Save alessaba/8877278f1d7581a6fd2a0115137d289a to your computer and use it in GitHub Desktop.
# coding: utf-8
from objutil import *
import ui
colorpicker = ObjCClass('OMColorPickerViewController').new().autorelease()
clview = colorpicker.view()
clview.frame = CGRect((0, 0), (512, 512))
view = presentUIView(clview, 'Color Picker', 'sheet')
def savecolor(sender):
cl = colorpicker.color()
print cl.hexStringFromColor()
bbi = ui.ButtonItem('Color Code', action=savecolor)
view.right_button_items = [bbi]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment