RGB Colors Reference


Basic RGB Procedures

(rgb-new r g b)
DrFu procedure. Build an RGB color whose red, green, and blue components are the specified values, each of which is an integer between 0 and 255 (inclusive).
(rgb-red color)
DrFu procedure. Get the red component of an RGB color.
(rgb-green color)
DrFu procedure. Get the green component of an RGB color.
(rgb-blue color)
DrFu procedure. Get the blue component of an RGB color.
(rgb? value)
DrFu predicate. Determine if value can be interpreted as an RGB color.

A Few Basic Colors

color-black
DrFu value. A predefined name for the color 0/0/0.
color-white
DrFu value. A predefined name for the color 255/255/255.
color-red
DrFu value. A predefined name for the color 255/0/0.
color-green
DrFu value. A predefined name for the color 0/255/0.
color-blue
DrFu value. A predefined name for the color 0/0/255.

Converting To and From RGB Colors

(rgb->cname rgb-color)
DrFu procedure. Convert the given color to a string that names the color. Note that color names approximate RGB colors (there are many fewer names than colors).
(rgb->list rgb-color)
DrFu procedure. Convert the given color to a list of its three components.
(rgb->string rgb-color)
DrFu procedure. Convert the given RGB color to an easy-to-read string. (The string is not so easy to convert back to an RGB color.)
(cname->rgb string)
DrFu Procedure. Build an RGB color that corresponds to the given color name.
(color->rgb string)
DrFu Procedure. Convert any of the myriad representations of colors to a corresponding RGB color.
(list->rgb rgb-lst)
DrFu procedure.. Converts a list representation of a color of the form (r g b) into an RGB color.

Transforming RGB Colors

(rgb-lighter rgb-color)
DrFu procedure. Build a lighter version of the given color.
(rgb-darker rgb-color)
DrFu RGB procedure. Build a darker version of the given color.
(rgb-redder rgb-color)
DrFu RGB procedure Build a redder version of the given color.
(rgb-greener rgb-color)
DrFu RGB procedure. Build a greener version of the given color.
(rgb-bluer rgb-color)
DrFu RGB procedure. Build a bluer version of the given color.
(rgb-rotate rgb-color)
DrFu RGB procedure..Rotate the three components of the given color, setting the red component to the value of green, green to the value of blue, and blue to the value of red..
(rgb-phaseshift rgb-color)
DrFu RGB procedure.Phase shift” the color by adding 128 to components less than 128 and subtracting 128 from components greater than 128.
(rgb-complement rgb-color)
DrFu RGB procedure. Compute the psuedo-complement of the given color.

Jerod Weinman