mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
image: Remove duplicated impl
This commit is contained in:
parent
84361878de
commit
d2bce0b9c1
16
colorm.go
16
colorm.go
@ -170,17 +170,7 @@ func TranslateColor(r, g, b, a float64) ColorM {
|
|||||||
|
|
||||||
// Deprecated as of 1.2.0-alpha. Use RotateHue member function instead.
|
// Deprecated as of 1.2.0-alpha. Use RotateHue member function instead.
|
||||||
func RotateHue(theta float64) ColorM {
|
func RotateHue(theta float64) ColorM {
|
||||||
sin, cos := math.Sincos(theta)
|
c := ColorM{}
|
||||||
v1 := cos + (1.0-cos)/3.0
|
c.RotateHue(theta)
|
||||||
v2 := (1.0/3.0)*(1.0-cos) - math.Sqrt(1.0/3.0)*sin
|
return c
|
||||||
v3 := (1.0/3.0)*(1.0-cos) + math.Sqrt(1.0/3.0)*sin
|
|
||||||
return ColorM{
|
|
||||||
initialized: true,
|
|
||||||
es: [ColorMDim - 1][ColorMDim]float64{
|
|
||||||
{v1, v2, v3, 0, 0},
|
|
||||||
{v3, v1, v2, 0, 0},
|
|
||||||
{v2, v3, v1, 0, 0},
|
|
||||||
{0, 0, 0, 1, 0},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user