result = cgCOLOR24(color)
The purpose of this function is to convert a RGB color triple
into the equivalent 24-bit long integer. The 24-bit integer
can be decomposed into the appropriate color by interpreting
the lowest 8 bits as red, the middle 8 bits as green, and the
highest 8 bits as blue. This routine was written to be used with
device-independent color programs like
A 24-bit long integer that can be decomposed into a color triple value.
- color in required
A three-element column or row array representing a color triple. Or an N-by-three element array of color triples. The values of the elements must be between 0 and 255.
To convert the color triple for the color YELLOW, (255, 255, 0), to the hexadecimal value '00FFFF'x or the decimal number 65535, type:
color = COLOR24([255, 255, 0])
FANNING SOFTWARE CONSULTING:
David W. Fanning 1645 Sheely Drive Fort Collins, CO 80526 USA Phone: 970-221-0438 E-mail: email@example.com Coyote's Guide to IDL Programming: http://www.idlcoyote.com
Copyright (c) 1996-2012, Fanning Software Consulting, Inc.
Written by: David Fanning, 3 February 96. Completely revised the algorithm to accept color arrays. 19 October 2000. DWF.
|Modification date:||Fri Mar 27 11:07:37 2015|