Java Code Examples for net.kyori.text.format.TextColor#RED

The following examples show how to use net.kyori.text.format.TextColor#RED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GDActiveFlagData.java    From GriefDefender with MIT License 6 votes vote down vote up
public TextColor getColor() {
    if (this.type == Type.CLAIM) {
        return TextColor.YELLOW;
    }
    if (this.type == Type.CLAIM_PARENT_INHERIT) {
        return TextColor.AQUA;
    }
    if (this.type == Type.OVERRIDE) {
        return TextColor.RED;
    }
    if (this.type == Type.OWNER_OVERRIDE_PARENT_INHERIT) {
        return TextColor.DARK_RED;
    }
    if (this.type == Type.DEFAULT) {
        return TextColor.LIGHT_PURPLE;
    }
    return TextColor.GRAY;
}
 
Example 2
Source File: GDActiveFlagData.java    From GriefDefender with MIT License 6 votes vote down vote up
public TextColor getColor() {
    if (this.type == Type.CLAIM) {
        return TextColor.YELLOW;
    }
    if (this.type == Type.CLAIM_PARENT_INHERIT) {
        return TextColor.AQUA;
    }
    if (this.type == Type.OVERRIDE) {
        return TextColor.RED;
    }
    if (this.type == Type.OWNER_OVERRIDE_PARENT_INHERIT) {
        return TextColor.DARK_RED;
    }
    if (this.type == Type.DEFAULT) {
        return TextColor.LIGHT_PURPLE;
    }
    return TextColor.GRAY;
}
 
Example 3
Source File: UIHelper.java    From GriefDefender with MIT License 5 votes vote down vote up
public static TextColor getPermissionMenuTypeColor(MenuType type) {
    TextColor color = TextColor.LIGHT_PURPLE;
    if (type == MenuType.DEFAULT) {
        color = TextColor.LIGHT_PURPLE;
    } else if (type == MenuType.CLAIM) {
        color = TextColor.GOLD;
    } else if (type == MenuType.INHERIT) {
        color = TextColor.AQUA;
    } else {
        color = TextColor.RED;
    }

    return color;
}
 
Example 4
Source File: CommandHelper.java    From GriefDefender with MIT License 5 votes vote down vote up
public static TextColor getPermissionMenuTypeColor(MenuType type) {
    TextColor color = TextColor.LIGHT_PURPLE;
    if (type == MenuType.CLAIM) {
        color = TextColor.GOLD;
    } else if (type == MenuType.OVERRIDE) {
        color = TextColor.RED;
    }

    return color;
}
 
Example 5
Source File: CommandHelper.java    From GriefDefender with MIT License 5 votes vote down vote up
public static TextColor getTransactionColor(TransactionResultType type) {
    switch (type) {
        case SUCCESS :
            return TextColor.GREEN;
        case FAIL :
            return TextColor.RED;
        default :
            return TextColor.GREEN;
    }
}
 
Example 6
Source File: UIHelper.java    From GriefDefender with MIT License 5 votes vote down vote up
public static TextColor getPermissionMenuTypeColor(MenuType type) {
    TextColor color = TextColor.LIGHT_PURPLE;
    if (type == MenuType.DEFAULT) {
        color = TextColor.LIGHT_PURPLE;
    } else if (type == MenuType.CLAIM) {
        color = TextColor.GOLD;
    } else if (type == MenuType.INHERIT) {
        color = TextColor.AQUA;
    } else {
        color = TextColor.RED;
    }

    return color;
}
 
Example 7
Source File: CommandHelper.java    From GriefDefender with MIT License 5 votes vote down vote up
public static TextColor getPermissionMenuTypeColor(MenuType type) {
    TextColor color = TextColor.LIGHT_PURPLE;
    if (type == MenuType.CLAIM) {
        color = TextColor.GOLD;
    } else if (type == MenuType.OVERRIDE) {
        color = TextColor.RED;
    }

    return color;
}
 
Example 8
Source File: CommandHelper.java    From GriefDefender with MIT License 5 votes vote down vote up
public static TextColor getTransactionColor(TransactionResultType type) {
    switch (type) {
        case SUCCESS :
            return TextColor.GREEN;
        case FAIL :
            return TextColor.RED;
        default :
            return TextColor.GREEN;
    }
}
 
Example 9
Source File: HealthModule.java    From spark with GNU General Public License v3.0 5 votes vote down vote up
public static TextComponent formatTps(double tps) {
    TextColor color;
    if (tps > 18.0) {
        color = TextColor.GREEN;
    } else if (tps > 16.0) {
        color = TextColor.YELLOW;
    } else {
        color = TextColor.RED;
    }

    return TextComponent.of( (tps > 20.0 ? "*" : "") + Math.min(Math.round(tps * 100.0) / 100.0, 20.0), color);
}
 
Example 10
Source File: HealthModule.java    From spark with GNU General Public License v3.0 5 votes vote down vote up
public static TextComponent formatTickDuration(double duration){
    TextColor color;
    if (duration >= 50d) {
        color = TextColor.RED;
    } else if (duration >= 40d) {
        color = TextColor.YELLOW;
    } else {
        color = TextColor.GREEN;
    }

    return TextComponent.of(String.format("%.1f", duration), color);
}
 
Example 11
Source File: HealthModule.java    From spark with GNU General Public License v3.0 5 votes vote down vote up
public static TextComponent formatCpuUsage(double usage) {
    TextColor color;
    if (usage > 0.9) {
        color = TextColor.RED;
    } else if (usage > 0.65) {
        color = TextColor.YELLOW;
    } else {
        color = TextColor.GREEN;
    }

    return TextComponent.of(FormatUtil.percent(usage, 1d), color);
}