fix cell.getFgColor/getBgColor return color256 code even it's color16

mode leading to serialize return wrong sequence
This commit is contained in:
javacs3
2019-11-21 20:41:47 +08:00
parent f12120b055
commit 6710c13cc2
2 changed files with 24 additions and 4 deletions
@@ -131,12 +131,14 @@ describe('SerializeAddon', () => {
it('serialize all rows of content with color16', async function (): Promise<any> {
this.timeout(20000);
const rows = 16;
const cols = 10;
const color16 = [
30, 31, 32, 33, 34, 35, 36, 37, // Set foreground color
40, 41, 42, 43, 44, 45, 46, 47 // Set background color
90, 91, 92, 93, 94, 95, 96, 97,
40, 41, 42, 43, 44, 45, 46, 47, // Set background color
100, 101, 103, 104, 105, 106, 107
];
const rows = color16.length;
const lines = newArray<string>(
(index: number) => digitsString(cols, index, `\x1b[${color16[index % color16.length]}m`),
rows