Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyAlpha ¶
ApplyAlpha scales the color with the given alpha. It can be used to reduce the intensity of a given color. The color is assumed to be linear, not sRGB.
func Blend ¶
Blend blends two colors together, assuming the colors are linear (not sRGB). The bottom alpha is assumed to be 0xff. The top alpha is used to blend the two colors together.
func Noise1 ¶
1D simplex noise.
The x input is a 19.12 fixed-point value. The result covers the full range of an int16 so is a 0.15 fixed-point value.
func Noise2 ¶
2D simplex noise.
The x and y inputs are 19.12 fixed-point value. The result covers the full range of an int16 so is a 0.15 fixed-point value.
func Noise3 ¶
3D simplex noise.
The x and y inputs are 19.12 fixed-point value. The result covers the full range of an int16 so is a 0.15 fixed-point value.
Types ¶
type Color ¶
Color encodes a HSV color.
The hue is 16-bits to get better looking colors, as HSV→RGB conversions generally can use more than 8 hue bits for their conversion. Saturation and value are both just 8 bits because saturation is not that often used and value does not gain much precision with extra bits. This encoding has been chosen to have the best colors while still fitting in 32 bits.
type Strip ¶
The LEDs of a LED strip. Colors are represented in RGB form: 0x00rrggbb.
func (Strip) FillSpectrum ¶
Fill the LED strip with a color range, using the HSV spectrum conversion. The start color is the color for the first LED. All other colors have the same saturation and value but increased (and wrapped) hue.