package terminal;

import com.googlecode.lanterna.TextColor;
import com.googlecode.lanterna.terminal.IOSafeTerminal;

public enum SelectGraphicRendition implements ControlSequence {

    RESET {

        @Override
        public String getCode() {
            return "0";
        }

        @Override
        public void applyTo(IOSafeTerminal terminal) {
            terminal.resetColorAndSGR();
        }
    },

    RED {

        @Override
        public String getCode() {
            return "31";
        }

        @Override
        public void applyTo(IOSafeTerminal terminal) {
            terminal.setForegroundColor(TextColor.ANSI.RED);
        }
    },

    GREEN {

        @Override
        public String getCode() {
            return "32";
        }

        @Override
        public void applyTo(IOSafeTerminal terminal) {
            terminal.setForegroundColor(TextColor.ANSI.GREEN);
        }
    },

    YELLOW {

        @Override
        public String getCode() {
            return "33";
        }

        @Override
        public void applyTo(IOSafeTerminal terminal) {
            terminal.setForegroundColor(TextColor.ANSI.YELLOW);
        }
    },

    PURPLE {

        @Override
        public String getCode() {
            return "35";
        }

        @Override
        public void applyTo(IOSafeTerminal terminal) {
            terminal.setForegroundColor(TextColor.ANSI.MAGENTA);
        }
    };

    public static final char SGR_COMMAND = 'm';

}