color

package
v0.0.0-...-6f71fe9 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidFormat = errors.New("invalid hex color format")

Functions

func ColourString

func ColourString(c color.Color) string

func Equals

func Equals(a, b color.Color) bool

func Gradient

func Gradient(n int, from, to color.Color) []color.Color

func GreyScale

func GreyScale(i int) color.Color

func MaxRGB

func MaxRGB(r, g, b uint32) uint32

MaxRGB returns the max value from the 3 components

func MinRGB

func MinRGB(r, g, b uint32) uint32

MinRGB returns the min value from the 3 components

func ParseColour

func ParseColour(hex string) (c color.RGBA, err error)

func RGBA

func RGBA(r, g, b uint32) color.RGBA

RGBA returns a color.RGBA instance based on the supplied 3 components

Types

type SizedColor

type SizedColor struct {
	Size  unit.Value
	Color color.Color
}

SizedColor is a size & colour but represented as a single xml attribute

func ParseSizedColor

func ParseSizedColor(s string) (SizedColor, error)

func (SizedColor) String

func (s SizedColor) String() string

Jump to

Keyboard shortcuts

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