color

package
v0.0.0-...-8583d5c Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RGBA

type RGBA struct {
	R, G, B, A uint8
}

RGBA represents a traditional 32-bit alpha-premultiplied color, having 8 bits for each of red, green, blue and alpha.

func ParseHex

func ParseHex(color string) (RGBA, error)

ParseHex parses an hex color to RGB color

func Rand

func Rand() RGBA

Rand returns a random RGB color

func (RGBA) Invert

func (c RGBA) Invert() RGBA

Invert returns the inverted RGB color

func (RGBA) ToHex

func (c RGBA) ToHex() string

ToHex exports the color to hexadecimal

Jump to

Keyboard shortcuts

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