This commit is contained in:
Daniel Imms
2019-01-25 20:51:19 -08:00
parent 62ac714d38
commit 1927bc899a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ export class ColorManager implements IColorManager {
}
// Coefficients taken from: https://www.w3.org/TR/AERT/#color-contrast
public getLuminance(color: IColor) : number {
public getLuminance(color: IColor): number {
const r = color.rgba >> 24 & 0xff;
const g = color.rgba >> 16 & 0xff;
const b = color.rgba >> 8 & 0xff;
+1 -1
View File
@@ -215,7 +215,7 @@ export class GlyphRenderer {
// TODO: Make fg and bg configurable, currently since the buffer doesn't
// support truecolor the char atlas cannot store it.
const lumi = this._colorManager.getLuminance(this._colorManager.colors.background)
const lumi = this._colorManager.getLuminance(this._colorManager.colors.background);
const fg = lumi > 0.5 ? 7 : 0;
const bg = lumi > 0.5 ? 0 : 7;