-- NewCGColor.mesa
-- Last edited by Maureen Stone, July 8, 1983 11:20 am
-- Last edited by Doug Wyatt, August 31, 1982 2:50 pm
-- Internal color definitions
Last Edited by: Plebon, August 30, 1983 5:22 pm
DIRECTORY
GraphicsBasic USING [Color];
NewCGColor: CEDAR DEFINITIONS = {
Color: TYPE = GraphicsBasic.Color;
GetStipple: PROC[color: Color] RETURNS[CARDINAL] = INLINE { RETURN[color.g*256+color.b] };
-- get a color's stipple pattern, assuming color.tag = stipple
The following convert between (hue, saturation, value) or (hue, saturation, lightness) and (red, green, blue).
All REALs except h should be in the range [0..1].
--h=undefined means it's a gray.
InvalidColor: SIGNAL;
undefined: REAL = -1;
HSVToRGB: PROC[h, s, v: REAL] RETURNS[r, g, b: REAL];
RGBToHSV:
PROC[r, g, b:
REAL]
RETURNS[h, s, v:
REAL];
--HSV hexacone model.
HSLToRGB: PROC[h, s, l: REAL] RETURNS[r, g, b: REAL];
RGBToHSL:
PROC[r, g, b:
REAL]
RETURNS[h, s, l:
REAL];
--HSL double hexacone model.
}.