mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
ae625255f2
commit
ffef8b433f
@ -87,6 +87,10 @@ func (c *ColorScale) SetA(a float32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Scale multiplies the given values to the current scale.
|
// Scale multiplies the given values to the current scale.
|
||||||
|
//
|
||||||
|
// Scale is slightly different from colorm.ColorM's Scale in terms of alphas.
|
||||||
|
// ColorScale is applied to premultiplied-alpha colors, while colorm.ColorM is applied to straight-alpha colors.
|
||||||
|
// Thus, colorm.ColorM.Scale(r, g, b, a) equals to ColorScale.Scale(r*a, g*a, b*a, a).
|
||||||
func (c *ColorScale) Scale(r, g, b, a float32) {
|
func (c *ColorScale) Scale(r, g, b, a float32) {
|
||||||
c.r_1 = (c.r_1+1)*r - 1
|
c.r_1 = (c.r_1+1)*r - 1
|
||||||
c.g_1 = (c.g_1+1)*g - 1
|
c.g_1 = (c.g_1+1)*g - 1
|
||||||
|
Loading…
Reference in New Issue
Block a user