We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68a08b0 commit 180ea9fCopy full SHA for 180ea9f
1 file changed
colour.go
@@ -52,7 +52,7 @@ type Colour int32
52
53
// NewColour creates a Colour directly from RGB values.
54
func NewColour(r, g, b uint8) Colour {
55
- return ParseColour(fmt.Sprintf("%02x%02x%02x", r, g, b))
+ return Colour(int32(r)<<16|int32(g)<<8|int32(b)) + 1
56
}
57
58
// Distance between this colour and another.
0 commit comments