colorrange

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: MIT Imports: 2 Imported by: 9

Documentation

Overview

Package colorrange holds distributions that accept and return color.Colors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Linear

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

Linear color ranges return colors on a linear distribution

func (Linear) EnforceRange

func (l Linear) EnforceRange(c color.Color) color.Color

EnforceRange rounds the input color's components so that they fall in the given range.

func (Linear) InRange

func (l Linear) InRange(c color.Color) bool

InRange returns whether the input color falls in this range

func (Linear) Percentile

func (l Linear) Percentile(f float64) color.Color

Percentile returns a color f percent along the color range

func (Linear) Poll

func (l Linear) Poll() color.Color

Poll returns a randomly chosen color in the bounds of this color range

type Linear64

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

Linear64 color ranges return colors on a linear distribution

func (Linear64) EnforceRange

func (l Linear64) EnforceRange(c color.Color) color.Color

EnforceRange rounds the input color's components so that they fall in the given range.

func (Linear64) InRange

func (l Linear64) InRange(c color.Color) bool

InRange returns whether the input color falls in this range

func (Linear64) Percentile

func (l Linear64) Percentile(f float64) color.Color

Percentile returns a color f percent along the color range

func (Linear64) Poll

func (l Linear64) Poll() color.Color

Poll returns a randomly chosen color in the bounds of this color range

type Range

type Range interface {
	Poll() color.Color
	InRange(color.Color) bool
	EnforceRange(color.Color) color.Color
	Percentile(f float64) color.Color
}

Range represents a range of colors

func NewLinear

func NewLinear(minColor, maxColor color.Color) Range

NewLinear returns a linear color distribution between min and maxColor

func NewLinear64

func NewLinear64(minColor, maxColor color.Color) Range

NewLinear64 returns a linear color distribution between min and maxColor

Jump to

Keyboard shortcuts

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