color

package
v0.0.0-...-4982ab1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package color contains types and functions for color management.

A new color type and model that represents colors as float64 along with functions:

Add
Prod
Scale

Index

Constants

This section is empty.

Variables

View Source
var FRGBAModel color.Model = color.ModelFunc(frgbaModel)

FRGBAModel for conversion of a color to FRGBA.

Functions

This section is empty.

Types

type FRGBA

type FRGBA struct {
	R, G, B, A float64
}

FRGBA represents a non-premultiplied RGBA tuple in floating point [0,1] such that the tuple can be added to, scaled and multiplied.

func NewFRGBA

func NewFRGBA(col color.Color) FRGBA

NewFRGBA returns a new FRGB using the supplied color.

func (FRGBA) Add

func (c FRGBA) Add(c1 FRGBA) FRGBA

Add returns the addition of c1 to the color (with clamping).

func (FRGBA) IsBlack

func (c FRGBA) IsBlack() bool

IsBlack returns true if the color is black.

func (FRGBA) Prod

func (c FRGBA) Prod(c1 FRGBA) FRGBA

Prod returns the product of c1 with the color.

func (FRGBA) RGBA

func (c FRGBA) RGBA() (uint32, uint32, uint32, uint32)

RGBA implements the RGBA function from the Color interface.

func (FRGBA) Scale

func (c FRGBA) Scale(v float64) FRGBA

Scale returns the color scaled by the value (except alpha).

Jump to

Keyboard shortcuts

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