Re: [I] [Bug] color parse() does not understand new spec rgb and hsl colors [echarts]

2024-02-28 Thread via GitHub


mayfield commented on issue #19604:
URL: https://github.com/apache/echarts/issues/19604#issuecomment-1969762365

   > Color formatting is a complex topic and I would suggest using a 
third-party library to convert it to normal color format and pass it to ECharts.
   
   I'm not looking for technical support.  I solved my issue with a workaround. 
 The point is that echarts is string parsing colors and only accepts a now 
deprecated color standard from the w3c spec.  It also fails in unexpected way 
and there is no docs to indicate that the color values accepted are limited to 
some legacy standards. 
   
   If the implemenation just used the browser engine to get the color value, no 
string parsing would be required btw.  I.e. something like
   
   ```javascript
   function domColor(colorString) {
 const el = document.createElement('div');
 el.style.display = 'none';
 el.style.color = 'gold';
 document.documentElement.append(el);
 try {
   return getComputedStyle(el).color;
 } finally {
   el.remove();
 }
   }
   ```


-- 
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: commits-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org



Re: [I] [Bug] color parse() does not understand new spec rgb and hsl colors [echarts]

2024-02-25 Thread via GitHub


Ovilia commented on issue #19604:
URL: https://github.com/apache/echarts/issues/19604#issuecomment-1963501970

   Color formatting is a complex topic and I would suggest using a third-party 
library to convert it to normal color format and pass it to ECharts.


-- 
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: commits-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org



[I] [Bug] color parse() does not understand new spec rgb and hsl colors [echarts]

2024-02-08 Thread via GitHub


mayfield opened a new issue, #19604:
URL: https://github.com/apache/echarts/issues/19604

   ### Version
   
   5.4.3
   
   ### Link to Minimal Reproduction
   
   NA
   
   ### Steps to Reproduce
   
   I have a bar chart with gradient fill of colors using the new w3c standard 
for hsl, a la., `hsl(229deg 73% 50%)` When I hover my chart the tooltip 
animation code tries to parse these colors for the keyframes and throws because 
the color.parse function does not understand this color format.
   
   ### Current Behavior
   
   color.parse('hsl(0deg 100%, 100%)`) returns undefined
   
   ### Expected Behavior
   
   color.parse('hsl(0deg 100%, 100%)`) returns some valid color value.
   
   ### Environment
   
   ```markdown
   - OS: NA
   - Browser: NA
   - Framework: NA
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
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: commits-unsubscr...@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org