From: Kevin Lamonte Date: Wed, 5 Apr 2017 22:26:01 +0000 (-0400) Subject: #5 rgbColors fix X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=8a632d71fde904c0a9f49259105aa90f5fbe2fea;p=nikiroo-utils.git #5 rgbColors fix --- diff --git a/src/jexer/bits/Cell.java b/src/jexer/bits/Cell.java index fd347be..eaaab6b 100644 --- a/src/jexer/bits/Cell.java +++ b/src/jexer/bits/Cell.java @@ -178,7 +178,7 @@ public final class Cell extends CellAttributes { */ @Override public String toString() { - return String.format("fore: %d back: %d bold: %s blink: %s ch %c", + return String.format("fore: %s back: %s bold: %s blink: %s ch %c", getForeColor(), getBackColor(), isBold(), isBlink(), ch); } } diff --git a/src/jexer/io/ECMA48Screen.java b/src/jexer/io/ECMA48Screen.java index 206c6e5..9daf6de 100644 --- a/src/jexer/io/ECMA48Screen.java +++ b/src/jexer/io/ECMA48Screen.java @@ -40,7 +40,7 @@ public final class ECMA48Screen extends Screen { /** * Emit debugging to stderr. */ - private boolean debugToStderr; + private boolean debugToStderr = false; /** * We call terminal.cursor() so need the instance. @@ -53,8 +53,6 @@ public final class ECMA48Screen extends Screen { * @param terminal ECMA48Terminal to use */ public ECMA48Screen(final ECMA48Terminal terminal) { - debugToStderr = false; - this.terminal = terminal; // Query the screen size diff --git a/src/jexer/io/ECMA48Terminal.java b/src/jexer/io/ECMA48Terminal.java index 6bc2fc8..0b1ce11 100644 --- a/src/jexer/io/ECMA48Terminal.java +++ b/src/jexer/io/ECMA48Terminal.java @@ -1493,7 +1493,8 @@ public final class ECMA48Terminal implements Runnable { sb.append("\033[0;"); } sb.append(String.format("%d;%dm", ecmaForeColor, ecmaBackColor)); - return sb.toString() + rgbColor(bold, foreColor, backColor); + sb.append(rgbColor(bold, foreColor, backColor)); + return sb.toString(); } /** @@ -1504,7 +1505,7 @@ public final class ECMA48Terminal implements Runnable { * e.g. "\033[0m" */ String normal() { - return normal(true); + return normal(true) + rgbColor(false, Color.WHITE, Color.BLACK); } /**