More work on ImageMagick

This commit is contained in:
Kovid Goyal
2023-01-03 21:14:29 +05:30
parent 4d21be9eb5
commit c317c934f3
7 changed files with 442 additions and 43 deletions

View File

@@ -14,6 +14,10 @@ type NRGBColor struct {
R, G, B uint8
}
func (c NRGBColor) AsSharp() string {
return fmt.Sprintf("#%02X%02X%02X", c.R, c.G, c.B)
}
func (c NRGBColor) RGBA() (r, g, b, a uint32) {
r = uint32(c.R)
r |= r << 8