Main Menu

search

You are here

Specifying Colors

[last updated: 2023-09-09]
Python: Programming
GUIzero
color format calculator

(link to:) GUIzero Colors on github
-----

Editing in process ...

  • Colors need to be specified (ie. uniquely defined) for webpages, computer apps, paint, etc.
    I saw a note that there are over 15 different formats that can be used to specify a color.


    Here I will only consider 3 formats:

    • string names:
        There are hundreds of named colors.
        See all here: wiki
        Some random ones...
        • white, black
        • red, green, blue
        • cyan, cornflower blue, turquoise
        • beige, khaki, thistle
        • medium purple, maroon3, orchid3
        • gray1 through gray98

    • RGB (red - green - blue):
        RGB can be specified:
      • in decimal eg: (255, 0, 0)
      • or in hex eg: #FFAB44 (6 hex characters)
          The "#" indicates that what follows is coded in hexadecimal.
          The 6 hex characters in an RGB color specification are really 3 pairs of characters, one pair for each color.
          A pair of hex characters can represent values up to 255.

          In this example, RGB = #FFAB44
          R = #FF = (decimal) 255
          G = #AB = (decimal) 171
          B = #44 = (decimal) 68

    • HSL format:
      • "HSL" is Hue, Saturation, and Lightness
      • Hue is what we might intuitively consider to be "shade" of color.
        It is usually listed in degrees, from 0 to 360
        0 and 360 are both full red, 60 is yellow, 120 is green, blue is 240
      • Saturation might be considered "inverse-grayness"
        That is, the more saturation, the less gray.
        It is listed as a percent, and expressed as decimal from 0 - 1.
        Sometimes it is expressed as a whole number (or float) percent, from 0 to 100
      • Lightness might be considered "inverse-blackness"
        Lower Lightness is more black.
        It is listed as a percent, and expressed as decimal from 0 - 1.
        Sometimes it is expressed as a whole number (or float) percent, from 0 to 100

    -----------------------------------------------------

  • study notes:
    • A given paint recipe/mix will specify quantities of primary pigments to create the specific color you want.
      In the HD paint machine, pigment quantities are listed in ounces and in 384ths of ounces.
    • To get a paint mix recipe:
      • Easy: The color is in the HD computer:
        This means the color you want is named from a swatch,
        or numbered from the old Glidden book,
        or you've done a color match from a physical sample from the match machine.
        • Create a new order on the HD paint computer, entering your desired color, and the computer will tell you the pigments and their amounts that are needed for the recipe.
      • Hard: you may need to manually edit the paint recipe. This is hugely complicated, mostly trial and error.
        • You must of course start with a recipe in hand that you want to edit. Get one (from 'Easy' procedure above) that's as close as possible to your desired color.
        • At this point you can proceed in different ways.
        • If you have the HSL of the color you want, you can calculate the RGB.
          But the HD paint computer doesn't use pure "R", and "G", and "B". Instead, it uses:
            BL = black
            FL = red
            RL = red/violet
            DL = green
            EL = blue
            TL = yellow
            CL = yel/brn/grn
            and others...
      • So ultimately you need to know that when you increment a recipe by some number of 384ths of a specific pigment,
        that it will change the actual color (RGB/HSL) by some known amount.
    • Get RGB/HSL codes for a color:
      • If you have a named Behr color, go to the Behr site (in links) and find it.
      • If your Behr color is not listed in the Behr site, or if you have a Glidden or PPG color that you want to find,
        go to the encyolorpedia site (in links) and enter the name or mfr code to get the rgb code

    -----------------------------------------------------

  • Links:

.

.

.

eof