tools

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Black color.RGBA = color.RGBA{0x00, 0x00, 0x00, 0xFF}
	White color.RGBA = color.RGBA{0xFF, 0xFF, 0xFF, 0xFF}
	Red   color.RGBA = color.RGBA{0xFF, 0x00, 0x00, 0xFF}
	Lime  color.RGBA = color.RGBA{0x00, 0xFF, 0x00, 0xFF}
	Blue  color.RGBA = color.RGBA{0x00, 0x00, 0xFF, 0xFF}

	Yellow  color.RGBA = color.RGBA{0xFF, 0xFF, 0x00, 0xFF}
	Aqua    color.RGBA = color.RGBA{0x00, 0xFF, 0xFF, 0xFF}
	Magenta color.RGBA = color.RGBA{0xFF, 0x00, 0xFF, 0xFF}

	Orange color.RGBA = color.RGBA{0xFF, 0xA5, 0x00, 0xFF}
	Green  color.RGBA = color.RGBA{0x00, 0x80, 0x00, 0xFF}
	Purple color.RGBA = color.RGBA{0x80, 0x00, 0x80, 0xFF}
	Indigo color.RGBA = color.RGBA{0x4B, 0x00, 0x82, 0xFF}
	Violet color.RGBA = color.RGBA{0xEE, 0x82, 0xEE, 0xFF}
)

https://www.w3schools.com/colors/colors_names.asp

Functions

func Lerp

func Lerp(a, b, ratio float64) float64

The ratio is capped between 0 and 1

func LerpColor

func LerpColor(a, b color.RGBA, ratio float64) color.RGBA

Creates a color between the given a and b. 0 means a is given, 1 means b is given, .5 is a color half way between. The ratio is capped between 0 and 1 Currently the function floors the number instead of rounding to nearest.

func LerpUint8

func LerpUint8(a, b uint8, ratio float64) uint8

The ratio is capped between 0 and 1 Currently the function floors the number instead of rounding to nearest.

Types

This section is empty.

Jump to

Keyboard shortcuts

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