Update shaded background color

This commit is contained in:
2022-04-04 12:37:58 +02:00
parent 78cd5b555e
commit eb89000ecf
12 changed files with 48 additions and 28 deletions

View File

@@ -94,6 +94,22 @@ func (h hsl) Add(hue int, saturation float64, lightness float64) hsl {
return new
}
func (h hsl) WithAlpha(alpha float64) HSLA {
return HSLA{h, alpha}
}
type HSLA struct {
hsl
Alpha float64
}
func (hsla HSLA) CSS() string {
return fmt.Sprintf(
"hsla(%d, %.2f%%, %.2f%%, %.2f)",
hsla.Hue, hsla.Saturation*100, hsla.Lightness*100, hsla.Alpha,
)
}
type RGB struct {
R uint8
G uint8