1. Removed logic to blend selection with background with 0.3 opacity from ColorManager to a function in color namespace.

2. Changed the DomRenderer and CanvasRenderer where the function defined in color namespace is called.
This commit is contained in:
Puneethnaik
2020-06-03 19:48:34 +05:30
parent 6daa3f4499
commit d5bc65ec0e
4 changed files with 15 additions and 14 deletions
-10
View File
@@ -116,16 +116,6 @@ export class ColorManager implements IColorManager {
this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);
this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);
this.colors.selection = this._parseColor(theme.selection, DEFAULT_SELECTION, true);
const [selectionR, selectionG, selectionB, selectionA] = rgba.toChannels(this.colors.selection.rgba);
// The selection color is opaque. It needs to be blended with background color at 0.3 opacity Issue #2737
if (selectionA === 0xFF) {
const opacity = 0.3;
const newAlpha = Math.round(opacity*255);
this.colors.selection = {
css: channels.toCss(selectionR, selectionG, selectionB, newAlpha),
rgba: channels.toRgba(selectionR, selectionG, selectionB, newAlpha)
};
}
this.colors.selectionOpaque = color.blend(this.colors.background, this.colors.selection);
this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);
this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);