Allow inverse colors to be stored in glyph keys

Fixes #1737
This commit is contained in:
Daniel Imms
2018-10-09 11:03:31 -07:00
parent 8d16bb6ea2
commit 791c020a56
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ export default class StaticCharAtlas extends BaseCharAtlas {
const isAscii = glyph.code < 256;
// A color is basic if it is one of the 4 bit ANSI colors.
const isBasicColor = glyph.fg < 16;
const isDefaultColor = glyph.fg >= 256;
const isDefaultColor = glyph.fg === 256;
const isDefaultBackground = glyph.bg >= 256;
return isAscii && (isBasicColor || isDefaultColor) && isDefaultBackground && !glyph.italic;
}
@@ -60,7 +60,7 @@ export default class StaticCharAtlas extends BaseCharAtlas {
let colorIndex = 0;
if (glyph.fg < 256) {
colorIndex = 2 + glyph.fg + (glyph.bold ? 16 : 0);
} else {
} else if (glyph.fg === 256) {
// If default color and bold
if (glyph.bold) {
colorIndex = 1;
+1 -1
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
export const INVERTED_DEFAULT_COLOR = -1;
export const INVERTED_DEFAULT_COLOR = 258;
export const DIM_OPACITY = 0.5;
export interface IGlyphIdentifier {