|
|
Section Intro: Color Manipulation
Color ManipulationSynopsis:
Meta-HTML provides a few primitives for manipulating HTML color strings
and names. You can convert from hexadecimal notation to decimal notation,
from color names to hex strings and back, create Commands:
Associate COLOR with NAME and NICKNAME in the system color tables and arrays. COLOR is the hexadecimal representation of the color, in standard RRGGBB format. NAME is a pretty name of the color, as in "Antique White".
Given a string of hex digits (perhaps with a leading "#"), return the human readable name of that color as defined in our array of color names. The color names are definitely suitable for Netscape, since I got the names off of their pages.
<color::color-name #F5FFFA>produces: Mint Cream
Return the two hex characters which represent BYTE-VALUE, a decimal number between 0 and 255 inclusive.
<color::decimal-to-hex 132>produces: 84
Given the human readable name of a color in COLOR, return the color value as a string of 6 hex digits: RRGGBB.
<color::hex-value "White Smoke">produces: F5F5F5
Return the "opposite" of COLOR in HTML format. COLOR is supplied
in HTML format as well. For example:
Return the decimal value of HEX-PAIR. <color::parse-hex-pair 84>produces: 132
Return an array of decimal values, one for each color in RGB-STRING.
<color::parse-rgb #ff78e4>produces: 255 224 228
Create an HTML SELECTion pull-down menu containing the list of colors taken from the list of known colors in the system array COLOR::COLOR-NAMES. Assign the choice to VARNAME when the containing form is POSTed.
Create an HTML SELECTion pull-down menu containing a short list of colors including the primaries and hues. Assign the choice to VARNAME when the containing form is POSTed.
Edit Section
![]() The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox Found a bug? Send mail to bug-manual@metahtml.org |