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

rgb r and b are working in reverse fashion... #239

Open
lotusquants opened this issue Apr 13, 2024 · 1 comment
Open

rgb r and b are working in reverse fashion... #239

lotusquants opened this issue Apr 13, 2024 · 1 comment

Comments

@lotusquants
Copy link

lotusquants commented Apr 13, 2024

Describe the bug
Skia.Color(r,g,b)
paint = skia.Paint(
AntiAlias=True,
Color=skia.ColorSetRGB(r = 0, g = 0, b = 189),
)

This should be blue..but gives red

and Color=skia.ColorSetRGB(r = 189, g = 0 b = 0), this should be red, but gives blue..

To Reproduce
Steps to reproduce the behavior:
Draw a rectangle with these colors and see..

Expected behavior
and Color=skia.ColorSetRGB(r = 189, g = 40, b = 40),

this should be red

Desktop (please complete the following information):

  • OS: ubuntu 22.04
  • Python: 3.10.12
  • skia-python version: 87.5

Additional context
Add any other context about the problem here.

@HinTak
Copy link
Collaborator

HinTak commented Apr 16, 2024

I am not able to reproduce this with the upcoming m124 (see #236 to download artefact under the action tab) . Please supply/confirm:

  • a full example
  • your arch - I am on x86_64 - are you running ubuntu on a pi (aarch64) or something unusual?
  • try m124 if you can - we'd unlikely to go back to m87.

I try SetRGB then ColorGetA(n) etc for the different channels, and also modified the code in #167 to draw with set colors. Looks okay.

Also, note there is no named argument matching, I think - i.e.if you do ColorSetRGB(b=..., r=..., g=...) in the wrong order, you get wrong color. It is also a bad idea to use Color as a variable name, for possible collisions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants