Skip to content

Color stuff

Hempfest edited this page Aug 31, 2021 · 3 revisions

Labyrinth has the ability to create gradient colors. This in the scheme of things means that we also fully support hexadecimal. Note that hex utility will only work in versions marked new such as (1.16, 1.17+)

Default Colors

You can find a small amount of native colors from the common module of laby.

DefaultColor.MANGO
DefaultColor.VELVET
DefaultColor.GALAXY
DefaultColor.RANDOM

Each of these objects represents that of a GradientColor object. An object designed specifically for color creation using hexadecimal formats.

Useability

So we have our colors now cool, but how do we use them? Its as easy as providing context and translating.

String context = "Hello jim.";
String wrapped = DefaultColor.GALAXY.context(context).translate();

Our text is now wrapped in our color selection.

Custom Colors

Every GradientColor is an inherent sub type of CustomColor. You have easy access to the creation of custom colors through the constructor of a GradientColor or the StringUtils class

String colored = StringUtils.use("Hello Jim.").gradient("HEX1", "HEX2").translate();
Clone this wiki locally