Separate bright and bold

This commit is contained in:
Linus Unnebäck
2018-05-07 22:19:01 +02:00
parent e48b15e859
commit 41fd563144
3 changed files with 19 additions and 14 deletions
+2 -2
View File
@@ -245,7 +245,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
protected drawChar(terminal: ITerminal, char: string, code: number, width: number, x: number, y: number, fg: number, bg: number, bold: boolean, dim: boolean, italic: boolean): void {
let colorIndex = 0;
if (fg < 256) {
colorIndex = fg + 2;
colorIndex = fg + 2 + (bold && terminal.options.enableBold ? 16 : 0);
} else {
// If default color and bold
if (bold && terminal.options.enableBold) {
@@ -273,7 +273,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
if (bold && !terminal.options.enableBold) {
// Ignore default color as it's not touched above
if (colorIndex > 1) {
colorIndex -= 8;
colorIndex -= 16;
}
}
-7
View File
@@ -116,13 +116,6 @@ export class TextRenderLayer extends BaseRenderLayer {
}
}
if (flags & FLAGS.BOLD) {
// Convert the FG color to the bold variant
if (fg < 8) {
fg += 8;
}
}
callback(code, char, width, x, y, fg, bg, flags);
}
}