Is your feature request related to a problem? Please describe.
Currently in pie charts there's logic in place for white text or black text
/** @internal */
export function colorIsDark(color: Color) {
// fixme this assumes a white or very light background
const rgba = stringToRGB(color);
const { r, g, b, opacity } = rgba;
const a = rgba.hasOwnProperty('opacity') ? opacity : 1;
return r * 0.299 + g * 0.587 + b * 0.114 < a * 150;
}
but this needs to account for relative luminance to be in accordance with WCAG standards for text and background contrast.
Additional context
This logic may be in place already in this elastic/kibana#60261 and we can potentially just move the logic onto the elastic-charts end.
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
Checklist
Delete any items that are not applicable to this feature request.
Is your feature request related to a problem? Please describe.
Currently in pie charts there's logic in place for white text or black text
but this needs to account for relative luminance to be in accordance with WCAG standards for text and background contrast.
Additional context
This logic may be in place already in this elastic/kibana#60261 and we can potentially just move the logic onto the elastic-charts end.
Kibana Cross Issues
Add any Kibana related issues/feature requests here.
Checklist
Delete any items that are not applicable to this feature request.
Kibana Cross Issueslistkibana cross issuetag is associated to the issue if any kibana cross issue is present