B4A Library Color module with standard naming for 138 colors

I was tired of researching, cutting and pasting RGB values so I created a code module with all of the named colors from this source and created types for the main color groups to make them more readily browsable.

1) Add the module to your project
2) From any module type Color. and you will get a list of color families. I'm selecting Greens
(Note: If you type colors you will get the built-in color picker. This is Color in singular)
3)
Screen Shot 2014-07-31 at 11.27.18 AM.png


4) Type a period after Greens and you will get a list of member colors
Screen Shot 2014-07-31 at 11.27.40 AM.png


B4X:
Dim MyTextColor As Int
MyTextColor = Color.Greens.dark_olive_green

5) Easy

I'd recommend you create your own Type for a color scheme

Type ColorScheme as (Foreground as Int, Background as int, ButtonColor as Int, TextColor as int)
Dim MyCS as ColorScheme 'CS = ColorScheme
MyCS.Foreground = color.Blues.deep_sky_blue

and then assign the colors you use to your own color scheme and then you can just reference your color scheme when you need it and have autocomplete to help you out.

MyButton.Color = MyCS.ButtonColor

This is my first contribution so I hope others find it useful. I found some other Color Picker tools but nothing on the developer side.

P.S. I have a spreadsheet showing all of the colors, names and RGB codes but it would not let me upload it to this site. You can use this link to lookup the colors.
 

Attachments

  • Color.bas
    8.5 KB · Views: 199
Last edited:
Top