[squeak-dev] color names for crayons

Ralph Boland rpboland at gmail.com
Sun May 7 18:53:29 UTC 2017


I am using Squeak 5.1.  Sorry if this has already been fixed.

It's nice to have the additional named colors (the crayon color names)
but unfortunately if you do for example:

   "Color banana name"

you don't get #banana but instead get the unnamed color specifics.
I wrote the following code to fix this.
Feel free to use it or even add it to the next version of squeak under
the squeak license.

Ralph Boland


initializeCrayonNames
"Name crayon colors. The following colors were removed as they are duplicates:
    maraschino (red)
    lemon (yellow)
    snow (white)
    licorice (black)
    cantaloupe (lightOrange)"

"Color initializeCrayonNames"
"example: Color blueberry name"

    | crayonColors |

    crayonColors := #(aluminum aqua asparagus banana blueberry
bubblegum cantaloupe carnation cayenne clover eggplant fern flora
grape honeydew ice iron lavender lead licorice lime magnesium maroon
mercury midnight mocha moss nickel ocean orchid plum salmon seaFoam
silver sky snow spindrift spring steel strawberry tangerine teal tin
tungsten turquoise).

    crayonColors do: [:color |
        self named: color put: (Color perform: color)].


More information about the Squeak-dev mailing list