color

package
v0.0.0-...-c6c79d5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PI_FACTOR = math.Pi / 2.

	PURPLE_STREAK = iota
	COLOR_STREAKS
	FAST_COLOR_STREAKS
	SOUND_COLOR_STREAKS
	FILL_RED
	SLOW_EQUALIZE
	FILL_EQUALIZE
	EQUALIZE
	STANDARD
	FLICKER
	AUDIO
	NUM_MODES
)
View Source
const (
	SINE_AMPLITUDE = 127
	SINE_SHIFT     = 127
)

Variables

View Source
var (
	TrueBlue = trueBlue

	TrueRed   = Make(255, 0, 0, 0)
	TrueWhite = Make(0, 0, 0, 255)

	// special color to tell beatboxer an active beat is occurring
	ActiveBeatPurple = Make(127, 127, 0, 127)

	Colors = []uint32{
		pink,
		trueBlue,
		red,
		lightGreen,
		TrueRed,
		deepPurple,
		TrueWhite,
		purple,
		mint,
		trueGreen,
	}

	Black  = black
	Purple = purple

	Red = binary.LittleEndian.Uint32([]byte{0x00, 0x00, 0x20, 0x00})
)

Functions

func AmpColor

func AmpColor(color uint32, ampLevel uint32) uint32

func Contains

func Contains(s []uint32, e uint32) bool

func GetSineVals

func GetSineVals(ledCount int, floatBeat float64, period int) (sineVals map[int]int)

func HeatColor

func HeatColor(temperature uint32) (uint32, uint32, uint32)

func Make

func Make(r uint32, g uint32, b uint32, w uint32) uint32

func MkColorWeight

func MkColorWeight(color1 uint32, color2 uint32, weight float64) uint32

func MultiplyColor

func MultiplyColor(color uint32, multiplier float64) uint32

func PrintColor

func PrintColor(color uint32)

func ScaleMotion

func ScaleMotion(x, y, z float64) uint32

func SineScale

func SineScale(weight float64) float64

TODO: cache?

Types

type Color

type Color struct {
	R, G, B, W uint32
}

func Split

func Split(color uint32) Color

type ColorPalette

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

func Init

func Init(colors []uint32) *ColorPalette

func (*ColorPalette) Get

func (c *ColorPalette) Get(weight float64) uint32

type ColorWeight

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

Jump to

Keyboard shortcuts

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