noxcolor

package
v0.0.0-...-77c44f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
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
)
View Source
const (
	TransparentRGBA5551   = RGBA5551(0x8000)
	Transparent32RGBA5551 = 0x80000000
)

Variables

View Source
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) Convert

func (m Model) Convert(c color.Color) color.Color

func (Model) Convert16

func (m Model) Convert16(c color.Color) Color16

func (Model) FromUint32

func (m Model) FromUint32(v uint32) Color16

FromUint32 unpacks color from uint32, according to this color model.

func (Model) NRGBA

func (m Model) NRGBA(r, g, b, a byte) Color16

NRGBA creates a Color16, according to this color model.

func (Model) RGB

func (m Model) RGB(r, g, b byte) Color16

RGB creates a Color16, according to this color model.

type RGB555

type RGB555 uint16

RGB555 stores RGB color in 15 bits (555).

func RGB555Color

func RGB555Color(r, g, b byte) RGB555

RGB555Color converts RGB color to RGB555.

func ToRGB555Color

func ToRGB555Color(c color.Color) RGB555

ToRGB555Color converts color.Color to RGB555.

func (RGB555) Color16

func (c RGB555) Color16() uint16

Color16 implements Color16.

func (RGB555) Color32

func (c RGB555) Color32() uint32

Color32 implements Color16.

func (RGB555) ColorNRGBA

func (c RGB555) ColorNRGBA() (v color.NRGBA)

ColorNRGBA implements Color.

func (RGB555) ColorRGBA

func (c RGB555) ColorRGBA() (v color.RGBA)

ColorRGBA implements Color.

func (RGB555) RGBA

func (c RGB555) RGBA() (r, g, b, a uint32)

RGBA implements color.Color.

type RGB565

type RGB565 uint16

RGB565 stores RGB color in 16 bits (565).

func RGB565Color

func RGB565Color(r, g, b byte) RGB565

RGB565Color converts RGBA color to RGB565.

func ToRGB565Color

func ToRGB565Color(c color.Color) RGB565

ToRGB565Color converts color.Color to RGB565.

func (RGB565) Color16

func (c RGB565) Color16() uint16

Color16 implements Color16.

func (RGB565) Color32

func (c RGB565) Color32() uint32

Color32 implements Color16.

func (RGB565) ColorNRGBA

func (c RGB565) ColorNRGBA() (v color.NRGBA)

ColorNRGBA implements Color.

func (RGB565) ColorRGBA

func (c RGB565) ColorRGBA() (v color.RGBA)

ColorRGBA implements Color.

func (RGB565) RGBA

func (c RGB565) RGBA() (r, g, b, a uint32)

RGBA implements color.Color.

type RGBA4444

type RGBA4444 uint16

RGBA4444 stores RGBA color in 16 bits (4444).

func RGB4444Color

func RGB4444Color(r, g, b byte) RGBA4444

RGB4444Color converts RGB color to RGBA4444.

func RGBA4444Color

func RGBA4444Color(r, g, b, a byte) RGBA4444

RGBA4444Color converts RGBA color to RGBA4444.

func ToRGBA4444Color

func ToRGBA4444Color(c color.Color) RGBA4444

ToRGBA4444Color converts color.Color to RGBA4444.

func (RGBA4444) Color16

func (c RGBA4444) Color16() uint16

Color16 implements Color16.

func (RGBA4444) Color32

func (c RGBA4444) Color32() uint32

Color32 implements Color16.

func (RGBA4444) ColorNRGBA

func (c RGBA4444) ColorNRGBA() (v color.NRGBA)

ColorNRGBA implements Color.

func (RGBA4444) ColorRGBA

func (c RGBA4444) ColorRGBA() (v color.RGBA)

ColorRGBA implements Color.

func (RGBA4444) RGBA

func (c RGBA4444) RGBA() (r, g, b, a uint32)

RGBA implements color.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

func RGB5551Color(r, g, b byte) RGBA5551

RGB5551Color converts RGB color to RGBA5551.

func RGBA5551Color

func RGBA5551Color(r, g, b, a byte) RGBA5551

RGBA5551Color converts RGBA color to RGBA5551.

func ToRGBA5551Color

func ToRGBA5551Color(c color.Color) RGBA5551

ToRGBA5551Color converts color.Color to RGBA5551.

func (RGBA5551) Color16

func (c RGBA5551) Color16() uint16

Color16 implements Color16.

func (RGBA5551) Color32

func (c RGBA5551) Color32() uint32

Color32 implements Color16.

func (RGBA5551) ColorNRGBA

func (c RGBA5551) ColorNRGBA() (v color.NRGBA)

ColorNRGBA implements Color.

func (RGBA5551) ColorRGBA

func (c RGBA5551) ColorRGBA() (v color.RGBA)

ColorRGBA implements Color.

func (RGBA5551) RGBA

func (c RGBA5551) RGBA() (r, g, b, a uint32)

RGBA implements color.Color.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL