ry
ry
发布于 2024-01-23 / 65 阅读 / 0 评论 / 0 点赞

命令行小工具

命令行彩色打印工具

public enum SystemColorEunm {
    WHITE(0),
    RED(31),
    GREEN(32),
    YELLOW(33),
    BLUE(34),
    PURPLE(35),
    CYAN(36),
    GREY(37);

    SystemColorEunm(int color){
        this.color = color;
    }

    private int color;
    public String paint(String content){
        return String.format("\033[;%dm%s\033[0m",color,content);
    }
}


评论