Quantcast

color names for crayons

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

color names for crayons

Ralph Boland
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)].

Loading...