B4J Library jSLColor Lookup Table

Here's the B4j version of the Color Lookup Table

SlColorLUT
Author:
Steve Laming
Version: 1

  • Methods:
    • getAllNames As String() - [Read Only]
      Returns all color names in an array - Sorted

      getAndroidColorInt(Name As String) As String - [Read Only]
      Returns the android colorint for the color name provided or NF if not found. As a string

      getColorName(Hex As String) As String - [Read Only]
      Returns the string name of a color represented by the hex representation. As a string Returns "NF" if not found

      getColorOpacity(Color As Object) As float - [Read Only]
      Returns the opacity of the color as float in the range 0.0 - 1.0
      Requires ajavafx.scene.paint.Color object


      getPaint(Name As String) As Object - [Read Only]
      Returns a javafx.scene.paint.Paint object for the given Name

      getRGBHex(Name As String) As String - [Read Only]
      Returns an RGBHex string representation of for the color name provided or NF if not found. As a string

      Initialize As String
      Initializes the object.

      IsInitialized As boolean
      Tests whether the object has been initialized.

      Depends on:
      JavaObject

jSLColorLUT.zip contains the library ,copy the jar and xml to you addl libs folder

ColorRefLibtest.zip contains B4j project with very simple tests

ColorRef.zip contains a B4j project that displays the colors and names in a ListView.
For use with B4j or other development environments, there is a copy to clipboard functiion. When selected, Click on the name and it will be copied to the clipboard, click on the color or the 2nd label (which contains the Hex ref) and the Hex ref will be copied to the clipboard. If Show Android is selected, clicking on the color or 2nd label will copy the Android color int to the clipboard.
 

Attachments

  • jSLColorLUT.zip
    10.4 KB · Views: 539
  • ColorRefLibTest.zip
    723 bytes · Views: 525
  • ColorRef.zip
    5.2 KB · Views: 524
Top