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

Fix parsing color as sequence of byte ints #192

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Conengmo
Copy link
Member

@Conengmo Conengmo commented Mar 15, 2025

Closes #190.

Fix the issue: color components that are byte values between 0 and 255 should be converted to normalized floats between 0 and 1.

I noticed our code here is quite sparse. When addressing this code, I strive to add more checks and more meaningful error messages. Downside is that it makes the code more verbose, but I hope the explicitness is helpful.

I also added tests for the other parsing related functions.

@Conengmo Conengmo force-pushed the fix-parse-color-sequence-of-ints branch from 4c00bad to 10c0dcc Compare March 15, 2025 14:49
@Conengmo Conengmo changed the title Fix parsing color as sequence of ints 0-255 Fix parsing color as sequence of byte ints Mar 15, 2025
@Conengmo Conengmo marked this pull request as ready for review March 15, 2025 15:05
@Conengmo Conengmo force-pushed the fix-parse-color-sequence-of-ints branch from c9d9ad9 to 2de024f Compare March 15, 2025 15:10
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

Successfully merging this pull request may close these issues.

Colors given as tuple of ints are not working anymore for LinearColormap and StepColormap since v0.8.0
1 participant