Copilot commented on code in PR #40784:
URL: https://github.com/apache/superset/pull/40784#discussion_r3364298411
##########
superset-frontend/plugins/preset-chart-deckgl/src/components/Legend.tsx:
##########
@@ -105,8 +105,22 @@ const Legend = ({
}
const categories = Object.entries(categoriesObject).map(([k, v]) => {
- const style = { color: `rgba(${v.color?.join(', ')})` };
- const icon = v.enabled ? '\u25FC' : '\u25FB';
+ const color = `rgba(${v.color?.join(', ')})`;
Review Comment:
The CSS color string is built as `rgba(${v.color?.join(', ')})`, but deck.gl
`Color` arrays in this plugin commonly include alpha in the 0–255 range (see
`hexToRGB(..., alpha=255)` usage). CSS `rgba()` expects alpha in 0–1, so
semi-transparent category colors will be rendered as fully opaque in the legend
swatch (and border). Converting the 4th component to `a/255` (and defaulting to
1 when missing) will make the swatch match the actual layer color/opacity.
--
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]