Skip to content

Commit

Permalink
Fix dark gray problem on windows, fixes #277
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Jun 1, 2018
1 parent 685fc84 commit 340ebe2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ protected void processCursorToColumn(int x) throws IOException {
protected void processSetForegroundColorExt(int paletteIndex) throws IOException {
int color = Colors.roundColor(paletteIndex, 16);
info.attributes = (short) ((info.attributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color & 0x07]);
info.attributes = (short) ((info.attributes & ~FOREGROUND_INTENSITY) | (color > 8 ? FOREGROUND_INTENSITY : 0));
info.attributes = (short) ((info.attributes & ~FOREGROUND_INTENSITY) | (color >= 8 ? FOREGROUND_INTENSITY : 0));
applyAttribute();
}

@Override
protected void processSetBackgroundColorExt(int paletteIndex) throws IOException {
int color = Colors.roundColor(paletteIndex, 16);
info.attributes = (short) ((info.attributes & ~0x0070) | ANSI_BACKGROUND_COLOR_MAP[color & 0x07]);
info.attributes = (short) ((info.attributes & ~BACKGROUND_INTENSITY) | (color > 8 ? BACKGROUND_INTENSITY : 0));
info.attributes = (short) ((info.attributes & ~BACKGROUND_INTENSITY) | (color >= 8 ? BACKGROUND_INTENSITY : 0));
applyAttribute();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ protected void processCursorToColumn(int x) throws IOException {
protected void processSetForegroundColorExt(int paletteIndex) throws IOException {
int color = Colors.roundColor(paletteIndex, 16);
info.wAttributes = (short) ((info.wAttributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color & 0x07]);
info.wAttributes = (short) ((info.wAttributes & ~FOREGROUND_INTENSITY) | (color > 8 ? FOREGROUND_INTENSITY : 0));
info.wAttributes = (short) ((info.wAttributes & ~FOREGROUND_INTENSITY) | (color >= 8 ? FOREGROUND_INTENSITY : 0));
applyAttribute();
}

protected void processSetBackgroundColorExt(int paletteIndex) throws IOException {
int color = Colors.roundColor(paletteIndex, 16);
info.wAttributes = (short)((info.wAttributes & ~0x0070 ) | ANSI_BACKGROUND_COLOR_MAP[color & 0x07]);
info.wAttributes = (short) ((info.wAttributes & ~BACKGROUND_INTENSITY) | (color > 8 ? BACKGROUND_INTENSITY : 0));
info.wAttributes = (short) ((info.wAttributes & ~BACKGROUND_INTENSITY) | (color >= 8 ? BACKGROUND_INTENSITY : 0));
applyAttribute();
}

Expand Down

0 comments on commit 340ebe2

Please sign in to comment.