init(attribute, AnsiColor.forStandardColor(foreground), AnsiColor.forStandardColor(background));
buff.append(SEPARATOR); if (foreground.isStandardColor()) { buff.append(30 + foreground._standardColor.ordinal()); buff.append(SEPARATOR); if (background.isStandardColor()) { buff.append(40 + background._standardColor.ordinal());
init(attribute, AnsiColor.forStandardColor(foreground), AnsiColor.forStandardColor(background));
init(attribute, AnsiColor.forStandardColor(foreground), AnsiColor.forStandardColor(background));
buff.append(SEPARATOR); if (foreground.isStandardColor()) { buff.append(30 + foreground._standardColor.ordinal()); buff.append(SEPARATOR); if (background.isStandardColor()) { buff.append(40 + background._standardColor.ordinal());
public static AnsiColor forStandardColor(final Color color) { if (color == null) { return null; } switch (color) { case BLACK: return BLACK; case RED: return RED; case GREEN: return GREEN; case YELLOW: return YELLOW; case BLUE: return BLUE; case MAGENTA: return MAGENTA; case CYAN: return CYAN; case WHITE: return WHITE; default: return new AnsiColor(color); } } }
public static AnsiColor forStandardColor(final Color color) { if (color == null) { return null; } switch (color) { case BLACK: return BLACK; case RED: return RED; case GREEN: return GREEN; case YELLOW: return YELLOW; case BLUE: return BLUE; case MAGENTA: return MAGENTA; case CYAN: return CYAN; case WHITE: return WHITE; default: return new AnsiColor(color); } } }
buff.append(SEPARATOR); if (foreground.isStandardColor()) { buff.append(30 + foreground._standardColor.ordinal()); buff.append(SEPARATOR); if (background.isStandardColor()) { buff.append(40 + background._standardColor.ordinal());
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); }
public static AnsiColor forStandardColor(final Color color) { if (color == null) { return null; } switch (color) { case BLACK: return BLACK; case RED: return RED; case GREEN: return GREEN; case YELLOW: return YELLOW; case BLUE: return BLUE; case MAGENTA: return MAGENTA; case CYAN: return CYAN; case WHITE: return WHITE; default: return new AnsiColor(color); } } }
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); }
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); }
/** * 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)); }
/** * 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)); }
/** * 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)); }