-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor.go
25 lines (22 loc) · 820 Bytes
/
color.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package main
import (
"image/color"
)
var (
// DarkPurple has a dark purple hue around the outside and other colours in the middle
DarkPurple = color.RGBA64{470, 230, 1270, 65535}
// DarkPink has a dark pink hue around the outside and other colours in the middle
DarkPink = color.RGBA64{1063, 230, 1270, 65535}
// Greyscale is just greyscale...that's it
Greyscale = color.RGBA64{1000, 1000, 1000, 65535}
)
// GetPixelColor gets the pixel color based on number of iterations and the passed in multiplier
// the multiplier sets the hue
func GetPixelColor(iterations int, multiplier color.RGBA64) color.RGBA64 {
return color.RGBA64{
uint16((uint16(iterations) * multiplier.R) % 65535),
uint16((uint16(iterations) * multiplier.G) % 65535),
uint16((uint16(iterations) * multiplier.B) % 65535),
65535,
}
}