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
The HSP conversion will take an RGB to HSP and back and produce an RGB byte > 255.
Also, shifting the brightness by a small amount can produce a rather large change in hue.
const cs = require('color-space'); console.log('HSP:'); let rgb1 = [ 0xb7, 0xc7, 0xff ]; let hsp = cs.rgb.hsp(rgb1); let rgb2 = cs.hsp.rgb(hsp); console.log(` from RGB ${rgb1} to HSP ${round(hsp)}`); console.log(` back to RGB ${rgb2}`); hsp[2] += 6; let rgb3 = cs.hsp.rgb(hsp); console.log(` p+=6 to RGB ${rgb3}`); function round(vals) { return [Math.round(vals[0]), Math.round(vals[1]), Math.round(vals[2])]; }
Yields:
HSP: from RGB 183,199,255 to HSP 227,28,202 back to RGB 184,199,256 p+=6 to RGB 189,205,263
Also, the HSP conversion is rounding most of its output values, which probably isn't appropriate. It makes conversion unnecessarily lossy.
The text was updated successfully, but these errors were encountered:
FYI @hunmar
Sorry, something went wrong.
See also #38.
No branches or pull requests
The HSP conversion will take an RGB to HSP and back and produce an RGB byte > 255.
Also, shifting the brightness by a small amount can produce a rather large change in hue.
Yields:
Also, the HSP conversion is rounding most of its output values, which probably isn't appropriate. It makes conversion unnecessarily lossy.
The text was updated successfully, but these errors were encountered: