mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Color: fix alpha calculation < 16/255 and State-timeline threshold alpha (#35911)
This commit is contained in:
@@ -547,6 +547,12 @@ export function getConfig(opts: TimelineCoreOptions) {
|
||||
}
|
||||
|
||||
function getFillColor(fieldConfig: TimelineFieldConfig, color: string) {
|
||||
// if #rgba with pre-existing alpha. ignore fieldConfig.fillOpacity
|
||||
// e.g. thresholds with opacity
|
||||
if (color[0] === '#' && color.length === 9) {
|
||||
return color;
|
||||
}
|
||||
|
||||
const opacityPercent = (fieldConfig.fillOpacity ?? 100) / 100;
|
||||
return alpha(color, opacityPercent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user