color

package
v0.0.0-...-6c26119 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package color defines LED RGB color models and provides color utility methods.

Index

Constants

This section is empty.

Variables

View Source
var (
	AliceBlue      = NewRGB(240, 248, 255)
	AntiqueWhite   = NewRGB(250, 235, 215)
	Aqua           = NewRGB(0, 255, 255)
	Aquamarine     = NewRGB(127, 255, 212)
	Azure          = NewRGB(240, 255, 255)
	Beige          = NewRGB(245, 245, 220)
	Bisque         = NewRGB(255, 228, 196)
	Black          = NewRGB(0, 0, 0)
	BlanchedAlmond = NewRGB(255, 235, 205)
	Blue           = NewRGB(0, 0, 255)
	BlueViolet     = NewRGB(138, 43, 226)
	Brown          = NewRGB(165, 42, 42)
	Burlywood      = NewRGB(222, 184, 135)
	CadetBlue      = NewRGB(95, 158, 160)
	Chartreuse     = NewRGB(127, 255, 0)
	Chocolate      = NewRGB(210, 105, 30)
	Coral          = NewRGB(255, 127, 80)
	CornflowerBlue = NewRGB(100, 149, 237)
	CornSilk       = NewRGB(255, 248, 220)
	Crimson        = NewRGB(220, 20, 60)
	Cyan           = NewRGB(0, 255, 255)
	DarkBlue       = NewRGB(0, 0, 139)
	DarkCyan       = NewRGB(0, 139, 139)
	DarkGoldenrod  = NewRGB(184, 134, 11)
	DarkGray       = NewRGB(169, 169, 169)
	DarkGreen      = NewRGB(0, 100, 0)
	DarkGrey       = DarkGray
	DarkKhaki      = NewRGB(189, 183, 107)
	DarkMagenta    = NewRGB(139, 0, 139)
	DarkOliveGreen = NewRGB(85, 107, 47)
	DarkOrange     = NewRGB(255, 140, 0)
	DarkOrchid     = NewRGB(153, 50, 204)
	DarkRed        = NewRGB(139, 0, 0)
	DarkSalmon     = NewRGB(233, 150, 122)
	DarkSeaGreen   = NewRGB(143, 188, 143)
	DarkSlateBlue  = NewRGB(72, 61, 139)
	DarkSlateGray  = NewRGB(47, 79, 79)
	DarkSlateGrey  = DarkSlateGray
	DarkTurquoise  = NewRGB(0, 206, 209)
	DarkViolet     = NewRGB(148, 0, 211)
	DeepPink       = NewRGB(255, 20, 147)
	DeepSkyBlue    = NewRGB(0, 191, 255)
	DimGray        = NewRGB(105, 105, 105)
	DimGrey        = DimGray
	DodgerBlue     = NewRGB(30, 144, 255)
	Firebrick      = NewRGB(178, 34, 34)
	FloralWhite    = NewRGB(255, 250, 240)
	ForestGreen    = NewRGB(34, 139, 34)
	Fuchsia        = NewRGB(255, 0, 255)
	Gainsboro      = NewRGB(220, 220, 220)
	GhostWhite     = NewRGB(248, 248, 255)
	Gold           = NewRGB(255, 215, 0)
	Goldenrod      = NewRGB(218, 165, 32)
	Gray           = NewRGB(128, 128, 128)
	Green          = NewRGB(0, 128, 0)
	GreenYellow    = NewRGB(173, 255, 47)
	Grey           = Gray
	HoneyDew       = NewRGB(240, 255, 240)
	HotPink        = NewRGB(255, 105, 180)
	IndianRed      = NewRGB(205, 92, 92)
	Indigo         = NewRGB(75, 0, 130)
	Ivory          = NewRGB(255, 255, 240)
	Khaki          = NewRGB(240, 230, 140)
	Lavender       = NewRGB(230, 230, 250)
	LavenderBlush  = NewRGB(255, 240, 245)

	LemonChiffon         = NewRGB(255, 250, 205)
	LightBlue            = NewRGB(173, 216, 230)
	LightCoral           = NewRGB(240, 128, 128)
	LightCyan            = NewRGB(224, 255, 255)
	LightGoldenrodYellow = NewRGB(250, 250, 210)
	LightGray            = NewRGB(211, 211, 211)
	LightGreen           = NewRGB(144, 238, 144)
	LightGrey            = LightGray
	LightPink            = NewRGB(255, 182, 193)
	LightSalmon          = NewRGB(255, 160, 122)
	LightSeaGreen        = NewRGB(32, 178, 170)
	LightSkyBlue         = NewRGB(135, 206, 250)
	LightSlateGray       = NewRGB(119, 136, 153)
	LightSlateGrey       = LightSlateGray
	LightSteelBlue       = NewRGB(176, 196, 222)
	LightYellow          = NewRGB(255, 255, 224)
	Lime                 = NewRGB(0, 255, 0)
	LimeGreen            = NewRGB(50, 205, 50)
	Linen                = NewRGB(250, 240, 230)
	Magenta              = NewRGB(255, 0, 255)
	Maroon               = NewRGB(128, 0, 0)
	MediumAquamarine     = NewRGB(102, 205, 170)
	MediumBlue           = NewRGB(0, 0, 205)
	MediumOrchid         = NewRGB(186, 85, 211)
	MediumPurple         = NewRGB(147, 112, 219)
	MediumSeaGreen       = NewRGB(60, 179, 113)
	MediumSlateBlue      = NewRGB(123, 104, 238)
	MediumSpringGreen    = NewRGB(0, 250, 154)
	MediumTurquoise      = NewRGB(72, 209, 204)
	MediumVioletRed      = NewRGB(199, 21, 133)
	MidnightBlue         = NewRGB(25, 25, 112)
	MintCream            = NewRGB(245, 255, 250)
	MistyRose            = NewRGB(255, 228, 225)
	Moccasin             = NewRGB(255, 228, 181)
	NavajoWhite          = NewRGB(255, 222, 173)
	Navy                 = NewRGB(0, 0, 128)
	OldLace              = NewRGB(253, 245, 230)
	Olive                = NewRGB(128, 128, 0)
	OliveDrab            = NewRGB(107, 142, 35)
	Orange               = NewRGB(255, 165, 0)
	OrangeRed            = NewRGB(255, 69, 0)
	Orchid               = NewRGB(218, 112, 214)
	PaleGoldenrod        = NewRGB(238, 232, 170)
	PaleGreen            = NewRGB(152, 251, 152)
	PaleTurquoise        = NewRGB(175, 238, 238)
	PaleVioletRed        = NewRGB(219, 112, 147)
	PapayaWhip           = NewRGB(255, 239, 213)
	PeachPuff            = NewRGB(255, 218, 185)
	Peru                 = NewRGB(205, 133, 63)
	Pink                 = NewRGB(255, 192, 203)
	Plum                 = NewRGB(221, 160, 221)
	PowderBlue           = NewRGB(176, 224, 230)
	Purple               = NewRGB(128, 0, 128)
	Red                  = NewRGB(255, 0, 0)
	RosyBrown            = NewRGB(188, 143, 143)
	RoyalBlue            = NewRGB(65, 105, 225)
	SaddleBrown          = NewRGB(139, 69, 19)
	Salmon               = NewRGB(250, 128, 114)
	SandyBrown           = NewRGB(244, 164, 96)
	SeaGreen             = NewRGB(46, 139, 87)
	SeaShell             = NewRGB(255, 245, 238)
	Sienna               = NewRGB(160, 82, 45)
	Silver               = NewRGB(192, 192, 192)
	SkyBlue              = NewRGB(135, 206, 235)
	SlateBlue            = NewRGB(106, 90, 205)
	SlateGray            = NewRGB(112, 128, 144)
	SlateGrey            = SlateGray
	Snow                 = NewRGB(255, 250, 250)
	SpringGreen          = NewRGB(0, 255, 127)
	SteelBlue            = NewRGB(70, 130, 180)
	Tan                  = NewRGB(210, 180, 140)
	Teal                 = NewRGB(0, 128, 128)
	Thistle              = NewRGB(216, 191, 216)
	Tomato               = NewRGB(255, 99, 71)
	Transparent          = Black
	Turquoise            = NewRGB(64, 224, 208)
	Violet               = NewRGB(238, 130, 238)
	Wheat                = NewRGB(245, 222, 179)
	White                = NewRGB(255, 255, 255)
	WhiteSmoke           = NewRGB(245, 245, 245)
	Yellow               = NewRGB(255, 255, 0)
	YellowGreen          = NewRGB(154, 205, 50)
)

Functions

This section is empty.

Types

type HSV

type HSV struct {
	Hue        uint8
	Saturation uint8
	Value      uint8
}

HSV struct represents HSV color model. Unlike traditional HSV representation using uint16 for Hue (0-360 range) and uint8 (0-100 range) for Saturation and Value, all fields in HSV struct are represented with uint8 (range from 0-255).

For details see https://en.wikipedia.org/wiki/HSL_and_HSV

func NewHSV

func NewHSV(hue, saturation, value uint8) HSV

func NewHSVFromHEX

func NewHSVFromHEX(color uint32) HSV

NewHSVFromHEX takes 0xRRGGBB uint32 (24-bit actually, no alpha channel) color value and returns instance of HSV.

func NewHSVFromRGB

func NewHSVFromRGB(red, green, blue uint8) HSV

NewHSVFromRGB returns HSV instance created from the given red, green and blue colors.

func (HSV) RGB

func (c HSV) RGB() RGB

RGB converts this HSV color to RGB color model.

type RGB

type RGB struct {
	Red, Green, Blue uint8
}

RGB struct represents a 32-bit, having 8 bits for each of red, green and blue. Alpha is not supported.

func NewRGB

func NewRGB(red, green, blue uint8) RGB

NewRGB returns RGB instance with the given red, green and blue colors.

func NewRGBFromHEX

func NewRGBFromHEX(color uint32) RGB

NewRGBFromHEX takes 0xRRGGBB uint32 (24-bit actually, no alpha channel) color value and returns instance of RGB.

func NewRGBFromHSV

func NewRGBFromHSV(hue, saturation, value uint8) RGB

NewRGBFromHSV returns RGB instance created from the given HSV values.

func (RGB) HSV

func (c RGB) HSV() HSV

HSV converts this RGB color to HSV color model.

Jump to

Keyboard shortcuts

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