colourToBytes

Undocumented in source. Be warned that the author may not have intended to support it.
  1. ubyte[Format.sizeof] colourToBytes(Format data)
  2. ubyte[] colourToBytes(T data, SupportedFormat format)
    ubyte[]
    colourToBytes
    (
    T
    )

Examples

assert(colourToBytes(RGB888(72, 232, 248), SupportedFormat.bgr555) == [0xA9, 0x7F]);
assert(colourToBytes(RGB888(72, 232, 248), SupportedFormat.bgr565) == [0x49, 0xFF]);
assert(colourToBytes(RGB888(72, 232, 248), SupportedFormat.rgb888) == [72, 232, 248]);

Meta