References from Other Sources

Color Codes

The APL.Grid control accepts any of the 16,777,215 colors available, however it only understands scalar or integer RGB. HTML only understands hex RGB (plus color names -- no point getting into that.) All of the following are equivalent:

Hex RGB:             #AA7755
Abbreviated Hex RGB: #A75
Integer RGB:         (170 119 85)
Scalar integer:      5601194 ( == 256 {base} {reverse} 170 119 85)
Any six-character hex code consisting of three duplicates can be abbreviated as the three-character code. #FF22EE can be abbreviated #F2E. #AB68C1 cannot be abbreviated. Grid_Make can take any of the above formats and uses HexRGB to convert to APL.Grid-acceptable values. MakeTableFromGrid uses HexRGB to convert APL.Grid colors to HTML-compatible hex. If you give HexRGB any of the above as right argument, it performs the appropriate conversion hex-to-dec/dec-to-hex (hex arguments must be character, decimal arguments must be numeric.) If you want integer RGB returned from hex, supply 0 as the left argument (scalar is the default.) If you want lowercase hex returned from decimal conversion, supply 0 as the left argument (uppercase is the default.) HexRGB does not return three-character hex codes; I suppose it could be changed to do this, but it's unnecessary.

Bill (Actually there are 16,777,216 colors -- 0 is black. I don't think well in index-origin 0.)

horizontal line
to home page e-mail