amaannawab923 commented on code in PR #35211:
URL: https://github.com/apache/superset/pull/35211#discussion_r2366179761
##########
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) {
Review Comment:
True ... We can use these theming tokens .... only problem was the alpha
value is a bit low at anywhere between 0.04 to 0.15
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)`;
}
--
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]