Pixi.js: seems like rgb2hex or hex2string has bug

Created on 1 Mar 2019  路  6Comments  路  Source: pixijs/pixi.js

Expected Behavior

hex related color converter should work

Current Behavior

hex related color converter output incorrect for some value

Steps to Reproduce

Th P refers to PIXI

P.utils.hex2string(P.utils.rgb2hex([255, 255, 255]))

image

Environment

  • pixi.js version: 4.8.6
  • Browser & Version: Chrome 72.0.3626.109
  • OS & Version: macOS 10.14.3
馃憤 Not A Bug

All 6 comments

ho well here the fix for pixijs
(rgb[0]<<16|rgb[1]<<8|rgb[2])

it seem work
image

rgb array has values between 0.0 and 1.0 . not 0.0 and 255.0

Maybe we have to be more clear in docs.

That explains a lot of things. I work myself always with a range of 255 in rgb.
Is the term rgb that creates confusion.
I noticed this same problem in my editor at the time.
thank you for enlightening the situation.

OK, its normalized RGB now.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings