mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +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.
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user