css-color-function
css-color-function copied to clipboard
A parser and converter for Tab Atkins's proposed color function in CSS.
``` css .test { color: color(hsl(210, 10%, 85%) blend(hsl(330, 50%, 70%) 50%)); } ``` Error message says: Unable to parse color from string "hsl(330," can get the bug here too:...
Not an actual problem right now given that #19 has been reverted, but it turns out that Prettier currently always strips out these spaces: https://github.com/prettier/prettier/issues/4492#issuecomment-391342006 I almost missed this... given...
``` color(yellow blend(blue 50% hsl)) //=> rgb(128, 128, 128) ``` this is blending in `rgb` color space. Should be `rgb(0, 255, 128)` > hsl(60, 100%, 50%) + hsl(240, 100%, 50%)...
One adjuster: ``` color(hwb(120, 44%, 50%) w(+ 20%)) //=> rgb(143, 143, 143) | hwb(0, 56%, 44%) | hsl(0, 0%, 56%) ``` It's okay. Two adjusters: ``` color(hwb(120, 44%, 50%) w(+...
Test case: ```js it('should correctly subtract whiteness when hue angle is null', function () { convert('white whiteness(- 20%)', 'rgb(204, 204, 204)'); // hwb(0, 80%, 20%) }); ``` https://github.com/postcss/postcss-color-function/issues/40 From spec:...
This continues the revert/re-release we started in #33. This brings back the changes in #19. Those were meant to be included in a 2.x release, but they got released in...
I'm copying here an issue I opened in `postcss-color-function` since looks like the bug is originating from this specific module: > Hi, I'm trying to use this module to assign...
index.ts.d ```ts type Adjusters = 'red' | 'green' | 'blue' | 'alpha' | 'a' // RGBA | 'hue' | 'h' | 'saturation' | 's' | 'lightness' | 'l' | 'whiteness'...
`color.convert('color(cyan blend(red 50%))')` > rgb(128, 128, 128) `color.convert('color(rgb(1,1,1) blend(rgb(2,2,2) 50%))')` > Error: Unable to parse color from string "rgb(2,2,2" > at Object.Color (/Users/ccheney/Projects/colortest/node_modules/color/index.js:33:10) > at Object.exports.blend (/Users/ccheney/Projects/colortest/node_modules/css-color-function/lib/adjusters.js:39:15) > at /Users/ccheney/Projects/colortest/node_modules/css-color-function/lib/convert.js:56:20...
During [`color` module update](5bfe4f3) there was a fix to maintain compatibility, but final behavior doesn’t match the spec. Spec says: > Linearly interpolate each of the channels of the colors...