color

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 0 Imported by: 7

Documentation

Overview

Package color provides structs related to RGB colors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AverageRGB

type AverageRGB struct {
	// contains filtered or unexported fields
}

AverageRGB is used to calculate the average of RGBs.

func (*AverageRGB) Add

func (argb *AverageRGB) Add(rgb RGB)

Add adds a color to the average.

func (AverageRGB) Average

func (argb AverageRGB) Average() RGB

Average returns the average of all added colors.

func (AverageRGB) Count

func (argb AverageRGB) Count() uint

Count returns the number of colors added to the average

type RGB

type RGB struct {
	R float64
	G float64
	B float64
}

RGB represents a color with its values normalized between 0 to 1.

func NewRGB added in v1.1.2

func NewRGB(r, g, b float64) RGB

NewRGB returns a new RGB.

Jump to

Keyboard shortcuts

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