Documentation ¶
Index ¶
Constants ¶
const ( // ModelRGBA5551 stores RGBA color in 16 bits (5551). // Alpha channel is inverted to be compatible with ModelRGB555. ModelRGBA5551 = Model(iota) // ModelRGB555 stores RGB color in 15 bits (555). ModelRGB555 // ModelRGB565 stores RGB color in 16 bits (565). ModelRGB565 // ModelRGBA4444 stores RGBA color in 16 bits (4444). ModelRGBA4444 )
const ( TransparentRGBA5551 = RGBA5551(0x8000) Transparent32RGBA5551 = 0x80000000 )
Variables ¶
var ( Black = RGB5551Color(0, 0, 0) Gray1 = RGB5551Color(8, 8, 8) Gray2 = RGB5551Color(115, 115, 115) Gray3 = RGB5551Color(212, 212, 212) White = RGB5551Color(255, 255, 255) Red = RGB5551Color(255, 0, 0) Green = RGB5551Color(0, 255, 0) Blue = RGB5551Color(0, 0, 255) DarkRed = RGB5551Color(100, 0, 0) DarkGreen = RGB5551Color(0, 100, 0) DarkBlue = RGB5551Color(0, 0, 140) LightRed = RGB5551Color(255, 128, 128) LightGreen = RGB5551Color(128, 255, 128) LightBlue = RGB5551Color(128, 128, 255) Purple = RGB5551Color(255, 0, 255) LightPurple = RGB5551Color(255, 180, 255) Yellow = RGB5551Color(255, 255, 0) LightYellow = RGB5551Color(255, 255, 128) Cyan = RGB5551Color(0, 160, 255) Orange = RGB5551Color(240, 180, 42) )
Functions ¶
This section is empty.
Types ¶
type Color ¶
type Color interface { color.Color // ColorNRGBA returns a color.NRGBA for this color. ColorNRGBA() color.NRGBA // ColorRGBA returns a color.RGBA for this color. ColorRGBA() color.RGBA }
Color extends color.Color to also implement ColorNRGBA.
type Color16 ¶
type Color16 interface { Color // Color16 returns color value as uint16. Color16() uint16 // Color32 returns color value as uint32. Color32() uint32 }
Color16 is an interface for colors that occupy 16 bits.
type Model ¶
type Model int
func (Model) FromUint32 ¶
FromUint32 unpacks color from uint32, according to this color model.
type RGB555 ¶
type RGB555 uint16
RGB555 stores RGB color in 15 bits (555).
func ToRGB555Color ¶
ToRGB555Color converts color.Color to RGB555.
func (RGB555) ColorNRGBA ¶
ColorNRGBA implements Color.
type RGB565 ¶
type RGB565 uint16
RGB565 stores RGB color in 16 bits (565).
func ToRGB565Color ¶
ToRGB565Color converts color.Color to RGB565.
func (RGB565) ColorNRGBA ¶
ColorNRGBA implements Color.
type RGBA4444 ¶
type RGBA4444 uint16
RGBA4444 stores RGBA color in 16 bits (4444).
func RGB4444Color ¶
RGB4444Color converts RGB color to RGBA4444.
func RGBA4444Color ¶
RGBA4444Color converts RGBA color to RGBA4444.
func ToRGBA4444Color ¶
ToRGBA4444Color converts color.Color to RGBA4444.
func (RGBA4444) ColorNRGBA ¶
ColorNRGBA implements Color.
type RGBA5551 ¶
type RGBA5551 uint16
RGBA5551 stores RGBA color in 16 bits (5551). Alpha channel is inverted to be compatible with RGB555.
func RGB5551Color ¶
RGB5551Color converts RGB color to RGBA5551.
func RGBA5551Color ¶
RGBA5551Color converts RGBA color to RGBA5551.
func ToRGBA5551Color ¶
ToRGBA5551Color converts color.Color to RGBA5551.
func (RGBA5551) ColorNRGBA ¶
ColorNRGBA implements Color.