mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
parent
ffef8b433f
commit
8b267265ed
@ -90,7 +90,7 @@ func (c *ColorScale) SetA(a float32) {
|
||||
//
|
||||
// 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).
|
||||
// Thus, 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) {
|
||||
c.r_1 = (c.r_1+1)*r - 1
|
||||
c.g_1 = (c.g_1+1)*g - 1
|
||||
|
2
image.go
2
image.go
@ -114,7 +114,7 @@ type DrawImageOptions struct {
|
||||
//
|
||||
// ColorScale 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).
|
||||
// Thus, ColorM.Scale(r, g, b, a) equals to ColorScale.Scale(r*a, g*a, b*a, a).
|
||||
//
|
||||
// The default (zero) value is identity, which is (1, 1, 1, 1).
|
||||
ColorScale ColorScale
|
||||
|
Loading…
Reference in New Issue
Block a user