amaannawab923 commented on code in PR #35211:
URL: https://github.com/apache/superset/pull/35211#discussion_r2366181856


##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -170,12 +171,25 @@ function cellOffset({
 function cellBackground({
   value,
   colorPositiveNegative = false,
+  theme,
 }: {
   value: number;
   colorPositiveNegative: boolean;
+  theme: SupersetTheme;
 }) {
-  const r = colorPositiveNegative && value < 0 ? 150 : 0;
-  return `rgba(${r},0,0,0.2)`;
+  if (!colorPositiveNegative) {
+    const color = isThemeDark(theme)
+      ? 'rgba(255,255,255,0.3)'

Review Comment:
   Do not check for isThemeDark ... Directly use this 
   
   function cellBackground({
     value,
     colorPositiveNegative = false,
     theme,
   }: {
     value: number;
     colorPositiveNegative: boolean;
     theme: SupersetTheme;
   }) {
     if (!colorPositiveNegative) {
       const fillColor = theme.colorFillSecondary; 
       const { r, g, b } = tinycolor(fillColor).toRgb();
       return `rgba(${r},${g},${b},0.2)`; 
     }
   
     if (value < 0) {
       const errorColor = theme.colorError; // Use the main error color (red) 
instead of bg
       const { r, g, b } = tinycolor(errorColor).toRgb();
       return `rgba(${r},${g},${b},0.2)`; 
     }
   
     const successColor = theme.colorSuccess; // Use proper green success color
     const { r, g, b } = tinycolor(successColor).toRgb();
     return `rgba(${r},${g},${b},0.2)`;
   }
   
   it is better to rely on theming tokens directly
   



-- 
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]

Reply via email to