mirror of
https://codeberg.org/Codeberg/avatars.git
synced 2023-08-10 21:12:50 +03:00
write alpha only for transparent colors
This commit is contained in:
parent
526b5adead
commit
4f12f14411
3
main.go
3
main.go
@ -211,6 +211,9 @@ func (c *RGB) withAlpha(alpha float64) *RGB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *RGB) html() string {
|
func (c *RGB) html() string {
|
||||||
|
if (c.a == 255) {
|
||||||
|
return fmt.Sprintf("#%02x%02x%02x", c.r, c.g, c.b)
|
||||||
|
}
|
||||||
return fmt.Sprintf("#%02x%02x%02x%02x", c.r, c.g, c.b, c.a)
|
return fmt.Sprintf("#%02x%02x%02x%02x", c.r, c.g, c.b, c.a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user