package de.tobiasroeser.lambdatest.internal;

public class AnsiColor {

	public enum Color {
		YELLOW, GREEN, RED;
	}

	// ////////////////
	// non static part

	private Boolean enabled = true;

	public boolean isEnabled() {
		if (enabled == null) {
			// TODO check enabled
			enabled = true;
		}
		return enabled;
	}

	public String fg(Color yellow) {
		if (isEnabled()) {
			return "";
		} else {
			return "";
		}
	}

	public String reset() {
		if (isEnabled()) {
			return "";
		} else {
			return "";
		}
	}

}

@@ -71,48 +71,279 @@
 %0A%0A%09p
-ublic enum Color %7B%0A%09%09YELLOW, GREEN, RED;
+rivate static final char ESC = 27;%0A%09private static final String CSI = ESC + %22%5B%22;%0A%0A%09public enum Color %7B%0A%09%09BLACK(0),%0A%09%09RED(1),%0A%09%09GREEN(2),%0A%09%09YELLOW(3),%0A%09%09BLUE(4),%0A%09%09MAGENTA(5),%0A%09%09CYAN(6),%0A%09%09WHITE(7);%0A%0A%09%09public int code;%0A%0A%09%09private Color(int code) %7B%0A%09%09%09this.code = code;%0A%09%09%7D
 %0A%09%7D%0A
@@ -572,14 +572,147 @@
 lor 
-yellow
+color) %7B%0A%09%09if (isEnabled()) %7B%0A%09%09%09return CSI + (30 + color.code) + %22m%22;%0A%09%09%7D else %7B%0A%09%09%09return %22%22;%0A%09%09%7D%0A%09%7D%0A%0A%09public String fgBright(Color color
 ) %7B%0A
@@ -734,33 +734,62 @@
 ()) %7B%0A%09%09%09return 
-%22
+CSI + (30 + color.code) + %22;1m
 %22;%0A%09%09%7D else %7B%0A%09%09
@@ -860,25 +860,33 @@
 %7B%0A%09%09%09return 
-%22
+CSI + %220m
 %22;%0A%09%09%7D else 

Support for ANSI escape sequences. (refs #1)