hexcolor

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HexModel = color.ModelFunc(hexModel)

HexModel converts any Color to an Hex color.

Functions

func HexToRGBA

func HexToRGBA(h Hex) (r, g, b, a uint8)

Converts an Hex string to RGBA. If alpha is not specified, it defaults to 255 If it is not a valid hexadecimal number of the right width, a horrible yellow color is returned

Types

type Hex

type Hex string

Hex represents an RGB color in hexadecimal format.

The length must be 3 or 6 characters, preceded or not by a '#'.

func RGBAToHex

func RGBAToHex(r, g, b, a uint8) Hex

RGBAToHex converts an RGBA to a Hex string. If a == 255, the A is not specified in the hex string

func (Hex) RGBA

func (c Hex) RGBA() (uint32, uint32, uint32, uint32)

RGBA returns the alpha-premultiplied red, green, blue and alpha values for the Hex.

Jump to

Keyboard shortcuts

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