image: Remove duplicated impl

This commit is contained in:
Hajime Hoshi 2016-02-07 02:39:52 +09:00
parent 84361878de
commit d2bce0b9c1

View File

@ -170,17 +170,7 @@ func TranslateColor(r, g, b, a float64) ColorM {
// Deprecated as of 1.2.0-alpha. Use RotateHue member function instead.
func RotateHue(theta float64) ColorM {
sin, cos := math.Sincos(theta)
v1 := cos + (1.0-cos)/3.0
v2 := (1.0/3.0)*(1.0-cos) - math.Sqrt(1.0/3.0)*sin
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},
},
}
c := ColorM{}
c.RotateHue(theta)
return c
}