mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
058b8d5635
commit
b0b64e3610
@ -88,9 +88,5 @@ func (c *ColorScale) Scale(r, g, b, a float32) {
|
||||
// ScaleWithColor multiplies the given color values to the current scale.
|
||||
func (c *ColorScale) ScaleWithColor(clr color.Color) {
|
||||
cr, cg, cb, ca := clr.RGBA()
|
||||
if ca == 0 {
|
||||
c.Scale(0, 0, 0, 0)
|
||||
return
|
||||
}
|
||||
c.Scale(float32(cr)/float32(ca), float32(cg)/float32(ca), float32(cb)/float32(ca), float32(ca)/0xffff)
|
||||
c.Scale(float32(cr)/0xffff, float32(cg)/0xffff, float32(cb)/0xffff, float32(ca)/0xffff)
|
||||
}
|
||||
|
@ -1256,7 +1256,7 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 {
|
||||
op.ColorScale.SetG(5.0 / 8.0)
|
||||
op.ColorScale.SetB(6.0 / 8.0)
|
||||
op.ColorScale.SetA(7.0 / 8.0)
|
||||
op.ColorScale.Scale(1.0/4.0, 2.0/4.0, 3.0/4.0, 4.0/4.0)
|
||||
op.ColorScale.ScaleWithColor(color.RGBA{0x40, 0x80, 0xc0, 0xff})
|
||||
dst.DrawRectShader(w, h, s, op)
|
||||
|
||||
for j := 0; j < h; j++ {
|
||||
|
Loading…
Reference in New Issue
Block a user