/** * Prints formatted and colorized {@code format} to {@link System#err} * * @param format A format string whose output to be colorized * @param args Arguments referenced by the format specifiers in the format */ public void errFormat(final String format, final Object... args) { format(System.err, format, args); } }
/** * Creates new instanceof Ansi. * * @param attr attribute of text, null means don't change * @param foreground foreground color of text, null means don't change * @param background background color of text, null means don't change */ public Ansi(final Attribute attr, final AnsiColor foreground, final AnsiColor background) { init(attr, foreground, background); }
/** * Prints colorized {@code message} to {@link System#err} followed by newline * * @param message message to be colorized */ public void errLine(final String message) { print(System.err, message); }
/** * Prints colorized {@code message} to {@link System#out} followed by newline * * @param message message to be colorized */ public void outLine(final String message) { println(System.out, message); }
private String colorize(final String value, final Ansi ansi) { return ansi.colorize(StringUtilities.escape(value, false, isUnicodeOutputEnabled())); }
public AnsiTextOutput(final Writer writer, final ColorScheme colorScheme) { super(writer); final boolean light = colorScheme == ColorScheme.LIGHT; _keyword = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 21 : 33), null); _instruction = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 91 : 141), null); _label = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 249 : 249), null); _type = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 25 : 45), null); _typeVariable = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 29 : 79), null); _package = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 32 : 111), null); _method = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 162 : 212), null); _field = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 136 : 222), null); _local = new Ansi(Ansi.Attribute.NORMAL, (Ansi.AnsiColor) null, null); _literal = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 197 : 204), null); _textLiteral = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 28 : 42), null); _comment = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 244 : 244), null); _operator = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 242 : 247), null); _delimiter = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 242 : 252), null); _attribute = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 166 : 214), null); _error = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 196 : 196), null); }
/** * Prints colorized {@code message} to {@link System#out} followed by newline * * @param message message to be colorized */ public void outLine(final String message) { println(System.out, message); }
private String colorize(final String value, final Ansi ansi) { return ansi.colorize(StringUtilities.escape(value, false, isUnicodeOutputEnabled())); }
public AnsiTextOutput(final Writer writer, final ColorScheme colorScheme) { super(writer); final boolean light = colorScheme == ColorScheme.LIGHT; _keyword = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 21 : 33), null); _instruction = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 91 : 141), null); _label = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 249 : 249), null); _type = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 25 : 45), null); _typeVariable = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 29 : 79), null); _package = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 32 : 111), null); _method = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 162 : 212), null); _field = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 136 : 222), null); _local = new Ansi(Ansi.Attribute.NORMAL, (Ansi.AnsiColor) null, null); _literal = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 197 : 204), null); _textLiteral = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 28 : 42), null); _comment = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 244 : 244), null); _operator = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 242 : 247), null); _delimiter = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 242 : 252), null); _attribute = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 166 : 214), null); _error = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 196 : 196), null); }
/** * Prints colorized {@code message} to {@link System#err} followed by newline * * @param message message to be colorized */ public void errLine(final String message) { print(System.err, message); }
/** * Creates new instanceof Ansi. * * @param attr attribute of text, null means don't change * @param foreground foreground color of text, null means don't change * @param background background color of text, null means don't change */ public Ansi(final Attribute attr, final AnsiColor foreground, final AnsiColor background) { init(attr, foreground, background); }
/** * Prints formatted and colorized {@code format} to {@link System#out} * * @param format A format string whose output to be colorized * @param args Arguments referenced by the format specifiers in the format */ public void outFormat(final String format, final Object... args) { format(System.out, format, args); }
/** * Prints colorized {@code message} to {@link System#out} followed by newline * * @param message message to be colorized */ public void outLine(final String message) { println(System.out, message); }
private String colorize(final String value, final Ansi ansi) { return ansi.colorize(StringUtilities.escape(value, false, isUnicodeOutputEnabled())); }
public AnsiTextOutput(final Writer writer, final ColorScheme colorScheme) { super(writer); final boolean light = colorScheme == ColorScheme.LIGHT; _keyword = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 21 : 33), null); _instruction = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 91 : 141), null); _label = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 249 : 249), null); _type = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 25 : 45), null); _typeVariable = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 29 : 79), null); _package = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 32 : 111), null); _method = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 162 : 212), null); _field = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 136 : 222), null); _local = new Ansi(Ansi.Attribute.NORMAL, (Ansi.AnsiColor) null, null); _literal = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 197 : 204), null); _textLiteral = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 28 : 42), null); _comment = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 244 : 244), null); _operator = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 242 : 247), null); _delimiter = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 242 : 252), null); _attribute = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 166 : 214), null); _error = new Ansi(Ansi.Attribute.NORMAL, new Ansi.AnsiColor(light ? 196 : 196), null); }
/** * Prints colorized {@code message} to {@link System#err} * * @param message message to be colorized */ public void err(final String message) { print(System.err, message); }
/** * Creates new instanceof Ansi. * * @param attr attribute of text, null means don't change * @param foreground foreground color of text, null means don't change * @param background background color of text, null means don't change */ public Ansi(final Attribute attr, final AnsiColor foreground, final AnsiColor background) { init(attr, foreground, background); }
/** * Prints formatted and colorized {@code format} to {@link System#err} * * @param format A format string whose output to be colorized * @param args Arguments referenced by the format specifiers in the format */ public void errFormat(final String format, final Object... args) { format(System.err, format, args); } }
/** * Prints colorized {@code message} to {@link System#out} * * @param message message to be colorized */ public void out(final String message) { print(System.out, message); }
/** * Creates new instanceof Ansi. * * @param attr attribute of text, null means don't change * @param foreground foreground color of text, null means don't change * @param background background color of text, null means don't change */ public Ansi(final Attribute attr, final Color foreground, final Color background) { init(attr, AnsiColor.forStandardColor(foreground), AnsiColor.forStandardColor(background)); }