Constant flic::codec::FLI_COLOR256 [] [src]

pub const FLI_COLOR256: u16 = 4

Magic for a FLI_COLOR256 chunk - 256-Level Color.

The data in this chunk is organized in packets. The first word following the chunk header is a count of the number of packets in the chunk.

Each packet consists of a one-byte color index skip count, a one-byte color count and three bytes of color information for each color defined.

At the start of the chunk, the color index is assumed to be zero. Before processing any colors in a packet, the color index skip count is added to the current color index. The number of colors defined in the packet is retrieved. A zero in this byte indicates 256 colors follow. The three bytes for each color define the red, green, and blue components of the color in that order. Each component can range from 0 (off) to 255 (full on). The data to change colors 2, 7, 8, and 9 would appear as follows:

    2                       ; two packets
    2,1,r,g,b               ; skip 2, change 1
    4,3,r,g,b,r,g,b,r,g,b   ; skip 4, change 3