colour

package
v0.0.0-...-81b0113 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Black is (0, 0, 0, 255)
	Black = New(0, 0, 0, 255)

	// White is (255, 255, 255, 255)
	White = New(255, 255, 255, 255)

	// Red is (255, 0, 0, 255)
	Red = New(255, 0, 0, 255)

	// Green is (0, 255, 0, 255)
	Green = New(0, 255, 0, 255)

	// Blue is (0, 0, 255, 255)
	Blue = New(0, 0, 255, 255)

	// Transparent is (0, 0, 0, 0)
	Transparent = New(0, 0, 0, 0)

	// Grey is (127, 127, 127, 255)
	Grey = New(127, 127, 127, 255)
)

Some predefined colours.

Functions

This section is empty.

Types

type Colour

type Colour struct {
	R, G, B, A uint8
}

A Colour represents a colour with four channels: r, g, b, and a.

func From

func From(c color.Color) *Colour

From creates a new Colour from a standard library image/colour Color.

func New

func New(r, g, b, a uint8) *Colour

New creates a new Colour from the supplied values.

func (*Colour) Channels

func (c *Colour) Channels() (uint8, uint8, uint8, uint8)

Channels returns the four colour channels as four return values.

Jump to

Keyboard shortcuts

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