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

BGR interpreted as RGB #532

Closed
tawheeler opened this issue Jun 10, 2023 · 1 comment
Closed

BGR interpreted as RGB #532

tawheeler opened this issue Jun 10, 2023 · 1 comment

Comments

@tawheeler
Copy link

Maybe I'm missing something, but the following behavior for BGR was unexpected:

> c = RGB(0.0, 0.5, 1.0); c.r
0.0
> d = BGR(0.0, 0.5, 1.0); d.r
0.0

I would have expected BGR to set its red channel to 1.0, but it appears to also be using the RGB ordering.

@timholy
Copy link
Member

timholy commented Jun 13, 2023

See the bold text in https://github.com/JuliaGraphics/ColorTypes.jl#rgb-plus-bgr-xrgb-rgbx-and-rgb24-the-abstractrgb-group. This is a debatable design decision but it allows generic programming without needing to know or care about the specific memory layout.

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