We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rgbToHsb() fails on any input containing { red: 255 }
rgbToHsb()
{ red: 255 }
I think the error is related to how rgbToHsb calculates hue when red is the largest color value.
rgbToHsb
red
rgbToHsb({red: 255, green: 0, blue: 183, alpha: 1})
This should return { hue: 317, ... }, which you can calculate using http://www.workwithcolor.com/color-converter-01.htm
{ hue: 317, ... }
This incorrectly returns { hue: 0, ... }
{ hue: 0, ... }
import { rgbToHsb } from "@shopify/polaris";
⚓️ We’re not accepting pull requests at this time 🗒 This repo is for reporting issues and feature requests only
The text was updated successfully, but these errors were encountered:
Here's the fix e2a72fe
Sorry, something went wrong.
Incidentally by rounding hue before the return you introduce precision loss that prevents a proper mapping between HSB and RGB.
hue
Hey @emcmanus, thanks for the issue. This should now be fixed as of 1.10.0.
No branches or pull requests
Issue summary
rgbToHsb()
fails on any input containing{ red: 255 }
I think the error is related to how
rgbToHsb
calculates hue whenred
is the largest color value.Expected behavior
This should return
{ hue: 317, ... }
, which you can calculate using http://www.workwithcolor.com/color-converter-01.htmActual behavior
This incorrectly returns
{ hue: 0, ... }
Steps to reproduce the problem
import { rgbToHsb } from "@shopify/polaris";
rgbToHsb()
with a value containing{ red: 255 }
Specifications
⚓️ We’re not accepting pull requests at this time
🗒 This repo is for reporting issues and feature requests only
The text was updated successfully, but these errors were encountered: