This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
tomo-old/theme/util.go

17 lines
331 B
Go
Raw Normal View History

2023-02-02 22:57:18 -07:00
package theme
import "image/color"
import "git.tebibyte.media/sashakoshka/tomo/artist"
func hex (color uint32) (c color.RGBA) {
c.A = uint8(color)
c.B = uint8(color >> 8)
c.G = uint8(color >> 16)
c.R = uint8(color >> 24)
return
}
func uhex (color uint32) (pattern artist.Pattern) {
return artist.NewUniform(hex(color))
}