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

OKLCH Color Support #20757

Open
meri-ddavis opened this issue Feb 13, 2025 · 2 comments
Open

OKLCH Color Support #20757

meri-ddavis opened this issue Feb 13, 2025 · 2 comments
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.

Comments

@meri-ddavis
Copy link

What problem does this feature solve?

Now that tailwind css is using oklch colors, it would be great to be able to pass them as the colors for ECHARTS. This would make it easier to have consistent colors in the charts and your web application.

Currently if you do this the series goes blank when you hover over it.

What does the proposed API look like?

Ideally you would be able to pass a list of oklch colors to the https://echarts.apache.org/en/option.html#color property.

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Feb 13, 2025
@helgasoft
Copy link

Ideally you would be able to pass a list of oklch colors to the color property.

All that's needed is the conversion function: color: [ok2rgb(0.45, 0.26, 264), ok2rgb(0.864, 0.162, 92), ...]
Demo.

📌 please close issue if problem solved.

@uhafner
Copy link

uhafner commented Feb 19, 2025

In Jenkins we also have the same problem! We recently switched to OKLCH and now our charts also show the reported problem. When someone hovers over the charts, then the charts are getting blank. The interesting thing is, that the OKLCH colors in the options parameter are correctly shown. Only the hover is broken. Even when we replace the OKLCH colors with RGB colors using the transformation shown in your suggested fix, then the background is broken. Does ECharts use other colors from the document to create the hover effect?

Example:

Bildschirmaufnahme.2025-02-17.um.23.27.27.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

3 participants