Jump to content

Pixi.js color accuracy


jasonsturges
 Share

Recommended Posts

Hi, my color values are off when rendering with Pixi.js

For example, here I have a fill with #3984c5, but am getting #4c84c0 on render.

const app = new PIXI.Application({});
document.body.appendChild(app.view);

var graphics = new PIXI.Graphics();
app.stage.addChild(graphics);

graphics.beginFill(0x3984c5)
graphics.drawRect(50, 50, 200, 200);
graphics.endFill  

https://codepen.io/jasonsturges/pen/PoYOdag

pixi-color.png

Perhaps 8-bit vs 16-bit, but my Pixi.js app colors are not matching the source Flash application being ported.

Something I'm missing, or not possible?

Thanks

Link to comment
Share on other sites

Gama correction. Pixi, as every other webgl or canvas2d app, as Flash apps uses sRGB 0x3984c5  . I dont know how did you get another color in Flash. However, if you open a screen in photoshop or something like that, the tool can report you linearRGB color number instead.

Perhaps 8-bit vs 16-bit, but my Pixi.js app colors are not matching the source Flash application being ported.

Are you sure they dont match on graphics and not something like PNG image?

Also, make sure your flash app doesnt have ColorMatrixFilter somewhere that you forgot about.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...