color

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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}
)

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

func (SimpleColor) String

func (sc SimpleColor) String() string

Jump to

Keyboard shortcuts

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