void Define_Color_Name (const char *name, const char *er_name, const char *ish_name, const char *definition)
 Adds a new color name (for example, "VERMILION") to the existing colors in the system's tables (for example, "RED"). More...
void UnDefine_Color_Name (const char *name)
 Removes all settings established by a previous call to Define_Color_Name(). More...

Detailed Description

Function Documentation

◆ Define_Color_Name()

void Define_Color_Name ( const char *  name,
const char *  er_name,
const char *  ish_name,
const char *  definition 

Adds a new color name (for example, "VERMILION") to the existing colors in the system's tables (for example, "RED").

name- Simple name to be added to the list of definitions.
er_name- The "er" (1st degree) combining form of the simple name above. E.g., "red-er" is to be spelled "REDDER".
ish_name- The "ish" (2nd degree) combining form, as in "RED DISH".
definition- The actual color, either in terms of colors that already exist, or as an absolute location in a color space.



The new name, er_name, ish_name are defined in the system as legal colors, and can be used anywhere built-in color name can be used. The choice of which name to define as what is up to you. If you define "purplish" as a variation of "army green", and "army green" as a synonym for "yellow", the system responds "of course". The syntax rules are liberal. The names can be as simple or as flowery as you please. Lastly, if you need several variations on a name, it is legal to list them all at once. For example
Define_Color_Name("aqua, my favorite", "", "", "blue-green")

with the variations separated by commas within the quoted string. You can leave any of name, er_name, and ish_name blank if you don't want to bother with the variations, or if a new variation is the only thing you want.

The execution sequence is evaluate the definition, delete any old definitions that conflict with new ones, and then enter the new names. This means that
Define_Color_Name("red", "redder", "reddish", "darkish red")

is a reasonable way to make the standard "red" color a little darker than it was, since the "darkish red" is evaluated before the "red" is deleted.

If an absolute color-space location is used for definition, the string should look like "X=val Y=val Z=val", where the "val"'s are floating-point numbers and the "XYZ" is either of the following:

"HLS" --  For hue, lightness, and saturation (a "double cone", with black and         
          white at the tips).                                                         
"HSV" --  For hue, saturation, and value (a "single cone" standing on its point,      
          with black at the tip and white at the center of the base).                 
"HIC" --  For hue, intensity, and chromaticity (a cylinder, with black and white at   
          the two ends).                                                              
"RGB" --  For red, green, and blue (a cube, with white, black, and six primary col    
          ors at the corners).                                                        

All numeric values must be in the range of zero to one inclusive, except for hues, which range from zero to 360degrees. If a hue is outside this range, the system normalizes the value.

UnDefine_Color_Name() , given just one name, removes that name from the system along with the whole group of related name variations that were defined at the same time. If you do want to list things to UnDefine_Color_Name() , that's permissible too.

Refer to the entry on color-naming, in the User's Manual, for more details on the grammatical rules for the definition.


Define_Color_Name() replaces Define_Color. The naming was changed in order to make the names of the "Show Color" routines more consistent.

The limit on the length of color names is large (on the order of 2^16 characters.)

A warning is given for redefining an already existing name.

If you write library subroutines, you might find it appropriate to use a standard prefix for all the color names you choose. Then your colors can't accidentally overlap with those chosen by the programs that will call your routines.

ISO Latin-1 characters may be used in color names. See Table 6.1 in Insert_Text() .


See also
Set_Color, Set_Color_Map, Set_Color_By_Value, Show_Color_Name.

◆ UnDefine_Color_Name()

void UnDefine_Color_Name ( const char *  name)

Removes all settings established by a previous call to Define_Color_Name().

name- Simple name to be added to the list of definitions.


No additional details. See Define_Color_Name()