color

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Black     = SimpleColor{}
	White     = SimpleColor{R: 1, G: 1, B: 1}
	LightGray = SimpleColor{.9, .9, .9}
	Gray      = SimpleColor{.5, .5, .5}
	DarkGray  = SimpleColor{.3, .3, .3}
	Red       = SimpleColor{1, 0, 0}
	Green     = SimpleColor{0, 1, 0}
	Blue      = SimpleColor{0, 0, 1}
	Yellow    = SimpleColor{.5, .5, 0}
)

Some popular colors.

View Source
var ErrInvalidColor = errors.New("pdfcpu: invalid color constant")

Functions

This section is empty.

Types

type SimpleColor

type SimpleColor struct {
	R, G, B float32 // intensities between 0 and 1.
}

SimpleColor is a simple rgb wrapper.

func NewSimpleColor

func NewSimpleColor(rgb uint32) SimpleColor

NewSimpleColor returns a SimpleColor for rgb in the form 0x00RRGGBB

func NewSimpleColorForArray

func NewSimpleColorForArray(arr types.Array) SimpleColor

NewSimpleColorForArray returns a SimpleColor for an r,g,b array.

func NewSimpleColorForHexCode

func NewSimpleColorForHexCode(hexCol string) (SimpleColor, error)

NewSimpleColorForHexCode returns a SimpleColor for a #FFFFFF type hexadecimal rgb color representation.

func ParseColor

func ParseColor(s string) (SimpleColor, error)

ParseColor turns a color string into a SimpleColor.

func (SimpleColor) Array

func (sc SimpleColor) Array() types.Array

Array returns an array representation for sc.

func (SimpleColor) String

func (sc SimpleColor) String() string

String returns the string value of sc.

Jump to

Keyboard shortcuts

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