tins2021/colors.go
Sander Schobers 13b6a50a45 Added bitmap font.
Added monsters.
Added animations.
Added rendering of geometries.
2021-08-09 01:25:51 +02:00

35 lines
729 B
Go

package tins2021
import (
"image/color"
"github.com/lucasb-eyer/go-colorful"
)
var Blue = `#499BFF`
var Gray = `#E5E5E5`
var Green = `#9BFF49`
var Orange = `#FF9849`
var Purple = `#9E49FF`
var Red = `#FF4949`
var Yellow = `#FFEF49`
func Darken(hexColor string, lighten float64) string { return Lighten(hexColor, -lighten) }
func Lighten(hexColor string, lighten float64) string {
color := mustHexColor(hexColor)
h, c, l := color.Hcl()
lightened := colorful.Hcl(h, c, Clamp(l+lighten)).Clamped()
return lightened.Hex()
}
func mustHexColor(s string) colorful.Color {
c, err := colorful.Hex(s)
if err != nil {
panic("invalid color")
}
return c
}
func MustHexColor(s string) color.Color { return mustHexColor(s) }