utils

package
v0.0.0-...-33c2882 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUNDAY dayOfWeekBitmask = 1 << iota
	SATURDAY
	FRIDAY
	THURSDAY
	WEDNESDAY
	TUESDAY
	MONDAY
)
View Source
const DatetimeLayout = "2006-01-02T15:04:05"

Mon Jan 2 15:04:05 MST 2006

Variables

This section is empty.

Functions

func Clamp

func Clamp(c *colorful.Color)

func DummyGateway

func DummyGateway(host string) string

Returns a "dummy" gateway (

func FromMirads

func FromMirads(temp uint16, bri uint8) colorful.Color

func GetHostPort

func GetHostPort(req *http.Request) (string, string)

func Hsv2Rainbow

func Hsv2Rainbow(h float64, s float64, v float64) colorful.Color

hsv2rgb_rainbow converted to operate on floats 0..1 from https://github.com/FastLED/FastLED/blob/master/hsv2rgb.cpp

func Linearize

func Linearize(v float64, gamma float64) float64

func Maximize

func Maximize(c *colorful.Color)

func RegisterApis

func RegisterApis(container *restful.Container, rootPath string, docString string, apis func(*restful.WebService))

Helper method to allow registering apis on the same endpoint

func RgbToRgbw

func RgbToRgbw(c colorful.Color, mir uint16) (rgb colorful.Color, w float64)

func RgbToRgbx

func RgbToRgbx(c colorful.Color, x colorful.Color) (rgb colorful.Color, x_val float64)

func ToMirads

func ToMirads(c colorful.Color) uint16

McCamy cubic approximation

func XCmpt

func XCmpt(c colorful.Color, x colorful.Color) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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