HTBasic Help
×
Menu
Index

AREA Color

 
Operation 5 in column 3 selects the AREA INTENSITY color. The column 1 value is divided into red, green, and blue numbers, each five bits in length (the sixteenth bit of column one is ignored). Each five-bit number specifies a value in the range zero to sixteen. This number is subtracted from sixteen to calculate the intensity value for each of the colors: red, green, blue. Intensities range in value from zero (darkest) to sixteen (most intense).
For example, if column 1 is set to zero, then each of the three groups in column 1 is set to zero. Sixteen minus zero yields sixteen for all three groups. Sixteen is full intensity, therefore, the area fill color will be white.
The following equation calculates the value for column 1 given R, G, B values in the range zero to one.
Column1 = 16-16*R + SHIFT(16-16*G,-5) + SHIFT(16-16*B,-10)
The AREA INTENSITY red, green, and blue values can also be selected with operations 14 and 15. The range of intensity is zero (no color) to 32,767 (full intensity). Operation 14 should be done before 15, and the operation takes effect when operation 15 is done.