B4J Library [ABMaterial]: MashColorPicker

Hi there

This MashPlugIns MashColorPicker enables one to pick a color from predefined color png and you can also specific the image you want to pick the color from.

MashColoPicker.gif


In the example we have 3 examples of picking a color from an image wheel, then from eric.png and also firefix.png.

B4X:
Dim mcp As MashColorPicker
    mcp.Initialize(page,"mcp","Eye Colour","","")
    page.Cell(3,1).AddComponent(mcp.ABMComp)
    
    Dim mcp1 As MashColorPicker
    mcp1.Initialize(page,"mcp1","Pick from FireFox","../images/firefox.png","")
    page.Cell(4,1).AddComponent(mcp1.ABMComp)
    
    Dim mcp2 As MashColorPicker
    mcp2.Initialize(page,"mcp2","Pick from Eric","../images/eric.png","")
    page.Cell(5,1).AddComponent(mcp2.ABMComp)

Just finalizing a few neat things about it...

This is just awesome!
 

Mashiane

Expert
Licensed User
Longtime User
Additional code..

To trap the color change event...

B4X:
Sub mcp3_change(value As Map)
    Dim valuex As String = value.Get("value")    
Log(valuex)
End Sub

Where valuex is the hex value of the selected color.

You can also get and set the hex color like this..

B4X:
Dim val As String = mcp3.GetColor

And to set one...

B4X:
mcp3.SetColor("#FE4D4D")


Another color pallete added..

B4X:
mcp3.Initialize(page,"mcp3","Pick from Most Colors","../images/most.png","")
    page.Cell(6,1).AddComponent(mcp3.ABMComp)

PickFromMost.png
 

joulongleu

Active Member
Licensed User
Longtime User
Hi mashiane: MashDateDropper and MashDateDropper can Additional change DateDropper or DateDropper event code? Thank You
 

ThRuST

Well-Known Member
Licensed User
Longtime User
Dear Marshiane, this looks totally awesome. It's part of the ABMaterials package right? Your avatar image makes me hungry :)
 
Top