B4i Library [class][custom view] Color Picker

Don't use. Nicer picker in XUI Views.



Wrapper for: https://github.com/johankasperi/SwiftHSVColorPicker

It is implemented as a custom view. The native library is accessed with NativeObject.

You need to add these two lines to the main module:
B4X:
#AdditionalLib: ColorPicker.framework.swift.3
#MinVersion: 8

Note that the color picker is not resizable. The size will be set based on the custom view initial size.

If you are using a local Mac then you need to download and copy the framework to the Mac Libs folder.
Xcode 9 Swift framework is attached.
Xcode 10: www.b4x.com/b4i/files/Xcode10SwiftFrameworks.zip
 

Attachments

  • ColorPicker.zip
    3.1 KB · Views: 83
  • ColorPicker.framework.zip
    155.6 KB · Views: 35
Last edited:

tufanv

Expert
Licensed User
Longtime User
I have a question. Does
ColorPicker.framework.swift.3 created by you according to b4i or you just put the framework from github and use nativeobject to use this ?
 

ilan

Expert
Licensed User
Longtime User
hi i am trying to use this color picker and i am getting an error:

 

kstainsb

Member
Licensed User
Longtime User
Hello, is it possible to set the inital color of the colorpicker when it first opens? I can't work out how to do that.
 

kstainsb

Member
Licensed User
Longtime User
Sorry, yes I meant via code - it doesn't seem to have a settable property to set the color in code. For example when I am changing the color of something, I want to set the color to an existing color first.
 

schimanski

Well-Known Member
Licensed User
Longtime User
When changing the screen-orientation, the ColorPicker doesn't resize with the following code:

B4X:
Private Sub pageColorPicker_Resize(Width As Int, Height As Int)
   ColorPicker1.GetBase.SetLayoutAnimated(0, 0, 0, 0, Width, Height)
End Sub

Is there another solution?