Author(s): Per Cederberg.
This module handles colors for usage in web pages, using the special web color format (with hexadecimal digits). The colors are handled as atoms, but are internally converted into numeric RGB representations.
color
)color
)
Usage 1: color2rgb(WebColor,RGBColor)
WebColor
(HTML hex coded color) to a RGBColor
. The RGBColor
is a term 'rgb(Red,Green,Blue)' where the color values should not be greater than 255 or less than 0.
WebColor
is an atom.
(atm/1
)
RGBColor
is a free variable.
(var/1
)
RGBColor
is any term.
(term/1
)
Usage 2: color2rgb(WebColor,RGBColor)
RGBColor
to a WebColor
(HTML hex coded color). The RGBColor
is a term 'rgb(Red,Green,Blue)' where the color values should not be greater than 255 or less than 0.
WebColor
is a free variable.
(var/1
)
RGBColor
is any term.
(term/1
)
WebColor
is an atom.
(atm/1
)
Usage: color2gray(Color,Gray)
Color
into a Gray
, using different weights for each one of the color components.
Color
is an atom.
(atm/1
)
Gray
is an atom.
(atm/1
)
Usage: color2bw(Color,BlackOrWhite)
BlackOrWhite
(black or white representation) of a Color
. The predicate uses the same intensity weighting as color2gray/2.
Color
is an atom.
(atm/1
)
BlackOrWhite
is an atom.
(atm/1
)
Usage: color_contrast(Color1,Color2)
Color1
and Color2
will have good contrast, i.e. that their color components differ sufficiently according to a weighted difference. If they don't, the predicate fails.
Color1
is an atom.
(atm/1
)
Color2
is an atom.
(atm/1
)
Usage: color_bw_contrast(Color1,Color2)
Color1
and Color2
will render to different colors on a black and white device. If the two colors will render to the same black or white representation, the predicate fails.
Color1
is an atom.
(atm/1
)
Color2
is an atom.
(atm/1
)
Go to the first, previous, next, last section, table of contents.