hep: go-hep.org/x/hep/groot/rsrv/internal/hexcolor Index | Files

package hexcolor

import "go-hep.org/x/hep/groot/rsrv/internal/hexcolor"


Package Files



var HexModel = color.ModelFunc(hexModel)

HexModel converts any Color to an Hex color.

func HexToRGBA Uses

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

type Hex Uses

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 Uses

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 Uses

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

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

Package hexcolor imports 4 packages (graph) and is imported by 1 packages. Updated 2019-05-31. Refresh now. Tools for package owners.