B4A Library hsv-alpha-color-picker

A "shortcut" wrap for this Github project. Extract DemoRes.zip, LibRes.zip, and resource.zip and then copy the folders (with their contents) to be on the same folder level as that of the /Files and /Objects folders of the attached B4A folder.

You need to enable DesignSupport (V2.00) and AppCompat (V3.20) for this project to work. Also take note of the B4A manifest file.

The actual color picker is smooth and not "blocky" like in the below gif file that demonstrates the color picker.

1.gif


Sample Code
B4X:
#Region  Project Attributes
    #ApplicationLabel: b4aHSValphaColorPicker
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

#AdditionalRes: ..\resource
#AdditionalRes: ..\LibRes
#AdditionalRes: ..\DemoRes


'#AdditionalRes: C:\Android\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'#AdditionalRes: C:\Android\extras\google\google-play-services\libproject\google-play-services_lib\res, com.google.android.gms
'#AdditionalRes: C:\Android\extras\android\support\design\res, android.support.design

'#ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby
'#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .gcm, .maps, .panorama

'#Extends: android.support.v7.app.AppCompatActivity

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
  
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private Button1 As Button
    Dim hsvacp As hsvAlphaColorPicker
  
  
    Private Label1 As Label
    Private Label2 As Label
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
  
    Activity.LoadLayout("main")
    hsvacp.Initialize("hsvacp")
  
  
End Sub

Sub Activity_Resume
  

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Button1_Click

    hsvacp.Start_Picker

End Sub

Sub hsvacp_selected_color(intcolor As Int, hexcolor As String)
  
    Label1.Text = "Int Color " & intcolor
    Label2.Text = "Hex Color = " & hexcolor
  
  
End Sub

Library:
hsvAlphaColorPicker
Author:
Github: Martin Stone, Wrapped by: Johan Schoeman
Version: 1
  • hsvAlphaColorPicker
    Events:
    • selected_color (intcolor As Int, hexcolor As String)
    Methods:
    • Initialize (paramString As String)
    • IsInitialized As Boolean
    • Start_Picker
 

Attachments

  • resource.zip
    424 bytes · Views: 355
  • LibRes.zip
    6.3 KB · Views: 337
  • b4aHSValphaColorPicker.zip
    8.8 KB · Views: 348
  • DemoRes.zip
    20.5 KB · Views: 350
  • hsvAlphaColorPickerLibFiles.zip
    29.6 KB · Views: 347
Last edited:

Johan Schoeman

Expert
Licensed User
Longtime User
are you missing colorpickerview methods?
I am missing what it is that you require from your question above. Please clarify. It is a short cut wrap. Not a full fledged wrap.
 
Top