ColorNames.mesa
Written by Maureen Stone on October 11, 1983 5:01 pm
Last Edited by: Ken Pier, January 18, 1984 12:52 pm
DIRECTORY
Rope USING [ROPE];
ColorNames: CEDAR DEFINITIONS =
BEGIN
UndefinedName: SIGNAL;
HueType: TYPE = {
undefined, black, white, gray, grey,
red, orangishRed, redOrange, reddishOrange, brownishRed, redBrown, reddishBrown,
orange, yellowishOrange, orangeYellow, orangishYellow,
brown, yellowishBrown, brownYellow, brownishYellow,
yellow, greenishYellow, yellowGreen, yellowishGreen,
green, bluishGreen, greenBlue, greenishBlue,
blue, purplishBlue, bluePurple, bluishPurple,
purple, reddishPurple, purpleRed, purplishRed
};
SaturationType: TYPE = {
default, achromatic, weak, moderate, strong, vivid
};
LightnessType: TYPE = {
default, veryDark, dark, medium, light, veryLight
};
Names: TYPE = RECORD[hue: HueType, saturation: SaturationType, lightness: LightnessType];
ParseColorName: PUBLIC PROCEDURE [rope: Rope.ROPE] RETURNS [Names];
Color naming system.
The hope is that this will be a set of "intuitive" descriptive names that people could type or select. A color name is composed of three properties, usually presented in order: lightness, saturation, hue. The current set of names for these properties is:
Lightness is one of: very dark, dark, medium, light, very light (default is medium)
Saturation is one of: weak, moderate, strong, vivid (default is vivid)
Hue is one of: red, orange, yellow, green, blue, purple, brown
You may also interpolate between the hue names as follows: red, orangish-red, red-orange, reddish-orange, orange... You may only interpolate between adjacent hues as defined in the list. Brown is actually a special case of orange, so you can interpolate from red to brown, and from brown to yellow.
There are three more hue names for achromatic colors: black, white and gray (grey).
Black and white are complete descriptions by themselves.
Gray may have a lighness parameter.
NamesToRope: PUBLIC PROCEDURE [names: Names] RETURNS [rope: Rope.ROPE];
NamesToHSL: PUBLIC PROCEDURE [names: Names] RETURNS [h,s,l: REAL];
HSLToNames: PUBLIC PROCEDURE [h,s,l: REAL] RETURNS [Names];
END.