/ForestColorAPI

Simple Color API for Minecraft plugins.

Primary LanguageJavaMIT LicenseMIT

ForestColorAPI

badge badge badge badge badge badge badge

JavaDoc 1.4

Small and effective Color API for your plugins.
Only 1.16+ version of spigot support!

Table of contents

Getting started

Make sure you reloaded maven or gradle in your project.

Add ForestColorAPI to your project

badge

You need to add this dependency into your plugin, then look at under the dependencies example

Maven
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.ForestTechMC</groupId>
        <artifactId>ForestColorAPI</artifactId>
        <version>VERSION</version>
        <scope>compile</scope>
    </dependency>
</dependencies>
Gradle
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.ForestTechMC:ForestColorAPI:VERSION'
}

Example of patterns

If you want to use gradient you need to use pattern like {#b36000>}Super gradient!{#72cc00<} For normal RGB {#72cc00}Super color!

Using Color API

// Example of removing chars, legacy colors, and patterns
String cleanMessage = ColorAPI.clear("{#b36000>}Super gradient{#72cc00<} &3Some color");
// Output -> "Super gradient Some color" message without patterns, colors, chars...
// You can use separate methods to clear only some kind of coloring

// Example of universal usage for colorize
player.sendMessage(ColorAPI.colorize("{#b36000>}Super gradient{#72cc00<} {#b36000}Super RGB color"));

// Example of gradient method
player.sendMessage(ColorAPI.colorizeGradient("{#b36000>}Super gradient{#72cc00<}"));

// Example of RGB method
player.sendMessage(ColorAPI.colorizeRGB("{#b36000}Super RGB color"));

// Example of classic method
player.sendMessage(ColorAPI.colorizeClassic("&3Some color"));

// Example of selecting colorize type <GRADIENT | RGB | CLASSIC>
player.sendMessage(ColorAPI.colorizeType(ColorizeType.RGB, "{#b36000}Super RGB color"));

License

ForestRedisAPI is licensed under the permissive MIT license. Please see LICENSE.txt for more information.