colors

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LUMINANCE_R = 0.299
	LUMINANCE_G = 0.587
	LUMINANCE_B = 0.114
)

Variables

This section is empty.

Functions

func GetLuminance

func GetLuminance(r, g, b byte, normalized bool) float64

func Hex2Rgb

func Hex2Rgb(hex string) (byte, byte, byte)

func Hsl2Rgb

func Hsl2Rgb(h, s, l float64) (byte, byte, byte)

func Hsv2Rgb

func Hsv2Rgb(h, s, v float64) (byte, byte, byte)

func Rgb2Hex

func Rgb2Hex(r, g, b byte) string

func Rgb2Hsl

func Rgb2Hsl(r, g, b byte) (float64, float64, float64)

func Rgb2Hsv

func Rgb2Hsv(r, g, b byte) (float64, float64, float64)

Types

type Color

type Color struct {
	R byte
	G byte
	B byte
	A byte
}

func NewColor

func NewColor(r, g, b byte) Color

func NewColorAnyArg added in v0.3.36

func NewColorAnyArg(arg ...interface{}) Color

func NewColorHSL

func NewColorHSL(h, s, l float64) Color

func NewColorHSV

func NewColorHSV(h, s, v float64) Color

func NewColorHexString

func NewColorHexString(hex string) Color

func NewColorRGBA

func NewColorRGBA(r, g, b, a byte) Color

func NewColorUint32 added in v0.1.40

func NewColorUint32(v uint32) Color

func (Color) Equal added in v0.1.43

func (this Color) Equal(c Color) bool

func (Color) EqualAny added in v0.3.36

func (this Color) EqualAny(arg ...interface{}) bool

func (Color) EqualTolerant added in v0.1.43

func (this Color) EqualTolerant(c Color, t byte) bool

func (Color) EqualTolerantAny added in v0.3.36

func (this Color) EqualTolerantAny(t byte, arg ...interface{}) bool

func (Color) H

func (this Color) H() float64

func (Color) HSL

func (this Color) HSL() (float64, float64, float64)

func (Color) HSV

func (this Color) HSV() (float64, float64, float64)

func (Color) Hex

func (this Color) Hex() string

func (Color) HexWithAlpha

func (this Color) HexWithAlpha() string

func (Color) Hue

func (this Color) Hue() float64

func (Color) L

func (this Color) L() float64

func (Color) Lightness

func (this Color) Lightness() float64

func (Color) RGB

func (this Color) RGB() (byte, byte, byte)

func (Color) RGBA

func (this Color) RGBA() (byte, byte, byte, byte)

func (Color) S

func (this Color) S() float64

func (Color) SL

func (this Color) SL() float64

func (Color) SV

func (this Color) SV() float64

func (Color) SaturationL

func (this Color) SaturationL() float64

func (Color) SaturationV

func (this Color) SaturationV() float64

func (Color) SetH

func (this Color) SetH(h float64)

func (Color) SetHSL

func (this Color) SetHSL(h, s, l float64)

func (Color) SetHSV

func (this Color) SetHSV(h, s, v float64)

func (Color) SetHex

func (this Color) SetHex(s string)

func (Color) SetL

func (this Color) SetL(l float64)

func (Color) SetLightness

func (this Color) SetLightness(l float64)

func (Color) SetRGBA

func (this Color) SetRGBA(r, g, b, a byte)

func (Color) SetS

func (this Color) SetS(s float64)

func (Color) SetSL

func (this Color) SetSL(s float64)

func (Color) SetSV

func (this Color) SetSV(s float64)

func (Color) SetSaturationL

func (this Color) SetSaturationL(s float64)

func (Color) SetSaturationV

func (this Color) SetSaturationV(s float64)

func (Color) SetV

func (this Color) SetV(v float64)

func (Color) SetValue

func (this Color) SetValue(v float64)

func (Color) ToRGBA added in v0.3.36

func (this Color) ToRGBA() color.RGBA

func (Color) Uint32 added in v0.1.40

func (this Color) Uint32() uint32

func (Color) V

func (this Color) V() float64

func (Color) Value

func (this Color) Value() float64

Jump to

Keyboard shortcuts

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