WORD Setcolor( idx, new )
WORD idx, new;
Setcolor() changes one color in the palette of the video chip.
Opcode
7 (0x07)
Availability
Parameters
idx is the number of color to change (0-15 or 0-255 on TT/Falcon in 256 colour mode).
new is a 16bit value holding the new color value to use, encoded as follows:
Bits 11-8 |
Bits 7-4 |
Bits 3-0 |
Red component |
Green component |
Blue component |
Each component is encoded as follows (for STE/TT/Falcon):
Bit 3 |
Bit 2 |
Bit 1 |
Bit 0 |
Component bit 0 |
Component bit 3 |
Component bit 2 |
Component bit 1 |
Bit 3 is not used on ST/STF machines, which only have 3 bits/component:
Bit 2 |
Bit 1 |
Bit 0 |
Component bit 2 |
Component bit 1 |
Component bit 0 |
If new is set to COL_INQUIRE (-1) then the current value is returned.
Binding
move.w #new,-(sp)
move.w #idx,-(sp)
move.w #$7,-(sp)
trap #14
addq.l #6,sp
See Also
VsetRGB()?,
EsetColor()?,
SetPalette()?