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

Incorrect conversion RGB to HSV #98

Closed
Elugormo opened this issue Jun 7, 2022 · 1 comment
Closed

Incorrect conversion RGB to HSV #98

Elugormo opened this issue Jun 7, 2022 · 1 comment

Comments

@Elugormo
Copy link

Elugormo commented Jun 7, 2022

When converting from RGB to HSV precision plays a big role. So when rounding some of the numbers, we don't convert the right color. The example is clear when converting the #f6f6f6 color to HSV. According to the internet resources we get:
image
To be more clear color will be - 0, 0, 96.47. As this library performs rounding on the end, it rounds it to 0, 0, 96, which is incorrect, because the RGB representation of this color will be #f5f5f5. I went through the source code, and found out, that we perform rounding on all models, but in some cases, it can cause serious difficulties because of this rounding bug. Maybe we should round to 1 decimal place instead?

@Qix-
Copy link
Owner

Qix- commented Jun 7, 2022

From the readme:

To get the unrounded (raw) results, simply tack on .raw to the function.

@Qix- Qix- closed this as completed Jun 7, 2022
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