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

HSV(0,255,255) gives RGB(255,1,0) ? #1

Open
perigalacticon opened this issue Oct 1, 2020 · 0 comments
Open

HSV(0,255,255) gives RGB(255,1,0) ? #1

perigalacticon opened this issue Oct 1, 2020 · 0 comments

Comments

@perigalacticon
Copy link

perigalacticon commented Oct 1, 2020

I was surprised to find that HSV(0,255,255) gives RGB(255,1,0) ? It should give RGB(255,0,0) right?

Or am I doing the calculation wrong?

  case 0:
    RedLight = v;
    GreenLight = tv;
    BlueLight = pv;

tv = v * (256 - s * fInv / 256) / 256;

tv = 255 * (256 - 255 * 255 / 256) / 256
= 255 * (256 - 254) / 256
= 1

Is this correct?

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

1 participant