Merge pull request #3932 from Tyriar/tyriar/dim_bg

Fix inverse dim rendering on canvas+webgl
This commit is contained in:
Daniel Imms
2022-07-29 14:50:47 -07:00
committed by GitHub
7 changed files with 77 additions and 29 deletions
+5
View File
@@ -84,6 +84,11 @@ export namespace color {
};
}
export function multiplyOpacity(color: IColor, factor: number): IColor {
const a = color.rgba & 0xFF;
return opacity(color, (a * factor) / 0xFF);
}
export function toColorRGB(color: IColor): IColorRGB {
return [(color.rgba >> 24) & 0xFF, (color.rgba >> 16) & 0xFF, (color.rgba >> 8) & 0xFF];
}