Documentation
¶
Overview ¶
Package color provides methods for working with colors
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HSB2RGB ¶
HSB2RGB convert HSB (HSV) color to RGB
Example ¶
r, g, b := HSB2RGB(331, 81, 50) fmt.Printf("r:%d g:%d b:%d\n", r, g, b)
Output: r:128 g:24 b:74
func Hex2RGB ¶
Hex2RGB convert Hex color to RGB
Example ¶
r, g, b := Hex2RGB(0x7F194B) fmt.Printf("r:%d g:%d b:%d\n", r, g, b)
Output: r:127 g:25 b:75
func Hex2RGBA ¶
Hex2RGBA convert Hex color to RGBA
Example ¶
r, g, b, a := Hex2RGBA(0x7F194BCC) fmt.Printf("r:%d g:%d b:%d a:%d\n", r, g, b, a)
Output: r:127 g:25 b:75 a:204
func IsRGBA ¶
IsRGBA if Hex coded color has alpha channel info
Example ¶
fmt.Println(IsRGBA(0xAABBCC)) fmt.Println(IsRGBA(0xAABBCCDD))
Output: false true
func RGB2HSB ¶
RGB2HSB convert RGB color to HSB (HSV)
Example ¶
h, s, v := RGB2HSB(127, 25, 75) fmt.Printf("h:%d s:%d v:%d\n", h, s, v)
Output: h:331 s:81 v:50
func RGB2Hex ¶
RGB2Hex convert RGB color to Hex
Example ¶
fmt.Printf("%x\n", RGB2Hex(127, 25, 75))
Output: 7f194b
func RGB2Term ¶
RGB2Term convert rgb color to terminal color code https://misc.flogisoft.com/bash/tip_colors_and_formatting#colors1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.