Skip to content

Commit

Permalink
following the experiments of PR #1983 settling for grey8 background w…
Browse files Browse the repository at this point in the history
…ith bright white foreground inside the bar and normal text outside the bar; also dropped all the underline and overline fringes for better consistency acros themes. works well with both dark and white themes now, due to the forced bright white foreground and they middle gray which has best contrast if you need to optimize for both dark and light backgrounds at the same time
  • Loading branch information
jurgenvinju committed Jun 22, 2024
1 parent 85ddcdb commit 9dd6b8e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/org/rascalmpl/repl/TerminalProgressBarMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,13 @@ else if (barWidth <= 3) { // we can print the clock for good measure

var line
= done
+ ANSI.lightBackground()
+ ANSI.underlined()
+ ANSI.overlined()
+ ANSI.grey8Background()
+ ANSI.brightWhiteForeground()
+ frontPart
+ ANSI.noBackground()
+ backPart
+ ANSI.normal()
+ backPart
// + ANSI.normal()
+ " " + clock + " "
+ String.format("%d:%02d:%02d.%03d", duration.toHoursPart(), duration.toMinutes(), duration.toSecondsPart(), duration.toMillisPart())
+ " "
Expand Down Expand Up @@ -406,6 +406,14 @@ static boolean isUTF8enabled(PrintWriter writer, InputStream in) {
}
}

public static String grey8Background() {
return "\u001B[48;5;240m";
}

public static String brightWhiteForeground() {
return "\u001B[97m";
}

static int getCursorPosition(PrintWriter writer, InputStream in) throws IOException {
writer.write(ANSI.printCursorPosition());
writer.flush();
Expand Down

0 comments on commit 9dd6b8e

Please sign in to comment.