Skip to content

Fix RGB to HSV converter#11

Open
Remiii wants to merge 1 commit intothatguydan:masterfrom
Remiii:fix-rgb2hsv-convert
Open

Fix RGB to HSV converter#11
Remiii wants to merge 1 commit intothatguydan:masterfrom
Remiii:fix-rgb2hsv-convert

Conversation

@Remiii
Copy link
Copy Markdown

@Remiii Remiii commented Nov 8, 2015

Fix RGB to HSV converter.

Round saturation and value is a mistake because value is between 0 to 1 and the numbers after the comma are important.

Error exemple with pink color:

Color pink => #FFC0CB => R: 255, G: 203, B: 192 => H: 350°, S: 0, V: 1

=> Saturation is set to 0 due to the Math.round... the good value is 0,25 for 25% of saturation.

And the good result must be:

Color pink => #FFC0CB => R: 255, G: 203, B: 192 => H: 350°, S: 0.25, V: 1

@Remiii
Copy link
Copy Markdown
Author

Remiii commented Jan 2, 2016

Do you have the same issue? Could you give me a feeback?

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.

1 participant