frenicohansen commented on issue #20757: URL: https://github.com/apache/echarts/issues/20757#issuecomment-2686362894
> [@frenicohansen](https://github.com/frenicohansen), thank you for pointing out _zRender_ repo for color parsing. https://github.com/ecomfe/zrender/blob/aa7187279fb306e12f3984f6f7f7fd4134635aea/src/tool/color.ts#L162 I see _rgb_ and _hsl_ formats checked, but no trace of _oklch_ in the entire repo. Mystery remains unsolved, at least to me... > > UPDATE: looks like color string falls back to a CSS definition somehow. So all [CSS color spaces](https://developer.mozilla.org/en-US/docs/Glossary/Color_space) are supported, not only _oklch_: > > ``` > 'color(rec2020 0.2 0.2 0.8)', > 'color(xyz 1 1 1 )', //transparent > 'color(display-p3 1 0.5 0)', > 'lch(from hsl(0 100% 50%) 29.6871% 66.83 327.109)', > 'lab(50% -120 125)', > 'hwb(50deg 30% 40%)', > 'oklab(from hsl(180 100% 50%) calc(l - 0.1) a b)', > ``` That's not a mystery. According to browser's spec, both the [canvas API](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle#value) and [SVG](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill) use CSS color values for fills. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
