Integer-Encoded RGB Colors
Basic Integer-Encoded RGB Procedures
-
(irgb-newrgb) - MediaScheme Color Procedure. Build an integer-encoded RGB color whose red, green, and blue components are the specified values, each of which is an integer between 0 and 255, inclusive. If given real values, rounds them to the nearest integer. If given values outside the bouds, caps them at the bounds.
-
(irgbrgb) - MediaScheme Color Procedure. Build an integer-encoded RGB color whose red, green, and blue components are the specified values, each of which is an integer between 0 and 255, inclusive. If given real values, rounds them to the nearest integer. If given values outside the bouds, caps them at the bounds.
-
(irgb-redirgb-color) - MediaScheme Color Procedure. Get the red component of an integer-encoded RGB color.
-
(irgb-greencolor) - MediaScheme Color Procedure. Get the green component of an integer-encoded RGB color.
-
(irgb-blueirgb-color) - MediaScheme Color Procedure. Get the blue component of an integer-encoded RGB color.
-
(irgb?value) - MediaScheme Color Predicate.
Determine if
valuecan be interpreted as an integer-encoded RGB color. Warning! Almost any integer can be interpreted as an integer-encoded RGB color.
Converting To and From Integer-Encoded RGB Colors
-
(irgb->color-nameirgb-color) - MediaScheme Color Procedure. Convert the given integer-encoded RGB color to a string that names a similar color. Note that this conversion approximates the RGB color as there are many fewer names than colors.
-
(irgb->hsvirgb-color) - MediaScheme Color Procedure. Convert the given integer-encoded RGB color to a list corresponding to the HSV (hue, saturation, value) representaiton.
-
(irgb->rgb-listirgb-color) - MediaScheme Color Procedure. Convert the given color to a list of its three components.
-
(irgb->stringirgb-color) - MediaScheme Color 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.)
-
(color-name->irgbstring) - MediaScheme Color Procedure. Get the integer-encoded RGB color that corresponds to the given color name.
-
(color->irgbstring) - MediaScheme Color Procedure. Convert any of the myriad representations of colors to a corresponding integer-encoded RGB color.
-
(color->hsvcolor) - MediaScheme Color Procedure. Convert any of the myriad representations of colors to a corresponding HSV (hue, saturation, value) representation.
-
(rgb-list->irgbrgb-lst) - MediaScheme Color Procedure.
Converts a list representation of a color of the form
(r g b)into an integer-encoded RGB color.
Transforming Integer-Encoded RGB Colors
-
(irgb-lighterirgb-color) - MediaScheme Color Procedure. Build a lighter version of the given color.
-
(irgb-darkerirgb-color) - MediaScheme Color Procedure. Build a darker version of the given color.
-
(irgb-redderirgb-color) - MediaScheme Color Procedure Build a redder version of the given color.
-
(irgb-greenerirgb-color) - MediaScheme Color Procedure. Build a greener version of the given color.
-
(irgb-bluerirgb-color) - MediaScheme Color Procedure. Build a bluer version of the given color.
-
(irgb-rotateirgb-color) - MediaScheme Color Procedure. Rotate the three components of the given color, setting the red component to the value of the green component, the green component to the value of the blue component, and blue compnent to the value of the red component.
-
(irgb-phaseshiftirgb-color) - MediaScheme Color Procedure.“Phase shift” the color by adding 128 to components less than 128 and subtracting 128 from components greater than 128.
-
(irgb-complementirgb-color) - MediaScheme Color Procedure. Compute the psuedo-complement of the given color.
Combining Integer-Encoded RGB Colors
-
(irgb-addirgb-color-1irgb-color-2) - MediaScheme Color Procedure.
Add the corresponding RGB components of
irgb-color-1andirgb-color-2. If any component sum is greater than 255, uses 255 for the resulting component. -
(irgb-averageirgb-color-1irgb-color-2) - MediaScheme Color Procedure.
Average the corresponding RGB components of
irgb-color-1andirgb-color-2. -
(irgb-subtractirgb-color-1irgb-color-2) - MediaScheme Color Procedure.
Subtract the RGB components of
irgb-color-2from the corresponding components ofirgb-color-1. If any component difference is less than 0, uses 0 for the resulting component.
Miscellaneous Integer-Encoded RGB Functions
-
(irgb-mapirgb-colorfun) - MediaScheme Color Procedure.
Create a new color by applying
funto each component ofcolor. -
(irgb->hueirgb-color) - MediaScheme Color Procedure. Get the hue of the given integer-encoded RGB color.
-
(irgb->saturationirgb-color) - MediaScheme Color Procedure. Get the saturation (from the HSV model) of the given integer-encoded RGB color.
-
(irgb->valueirgb-color) - MediaScheme Color Procedure. Get the value (from the HSV model) of the given integer-encoded RGB color.