Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenderTexture.draw with tint: red/blue values inverted #5509

Closed
anthonygood opened this issue Jan 16, 2021 · 1 comment
Closed

RenderTexture.draw with tint: red/blue values inverted #5509

anthonygood opened this issue Jan 16, 2021 · 1 comment

Comments

@anthonygood
Copy link

Version

  • Phaser Version: v3.51.0-FB
  • Operating system: MacOS 11.1 (Big Sur)

Description

Looks similar to this issue (which was apparently fixed): #3643

Example Test Code

When I use sprite.setTint(0xff0000), the sprite is tinted red as expected:

image

However, when drawing the frame to a render texture with renderTexture.draw(frame, 0, 0, 1, 0xff0000), the texture is tinted blue:
image

I added a crude function to swap the red and blue values, and the output looks correct:

export const invertRB = (colour: number) => {
  const [r,g,b] = colour.toString(16).padStart(6, '0').match(/[\w]{2}/g);
  return parseInt([b,g,r].join(''), 16);
}

image

@photonstorm
Copy link
Collaborator

Sorry for the delay in responding, but I can confirm this is definitely working properly now (and has been for a few versions)

photonstorm added a commit that referenced this issue Oct 10, 2022
…fying a `tint` value would inverse the Red and Blue channels. These are now handled properly. Fix #5509
sevikon added a commit to Alexander3/roots-war that referenced this issue Feb 4, 2023
-> render brush in specific color
-> random player from server (with different color)
-> fix BUG with phaser with brush color
phaserjs/phaser#5509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants