🟒Colours

red.jackf.jackfredlib.api.colour.Colour

Colours are literally that - objects that represent a single colour. They contain methods to convert two and from RGBA and HSV values, lerp between two colours, and obtain the Minecraft DyeColour that is closest to it. Some notable methods are below

fromRGB()

Creates a colour object from a given red, green and blue value. There is also a fromARGB() method that takes an alpha channel.

fromHSV()

Creates a colour object from a given hue, saturation and value. There is also a fromAHSV() method that takes an alpha channel.

For more information, see the Wikipedia page on HSV.

fromInt()

Creates a colour object from a packed integer in ARGB format.

lerp()

Blends this colour towards another by a specified factor. Uses linear interpolation, not HSV.

closestDyeColour()

Returns the closest Minecraft DyeColour to this colour. Currently uses the closest by Manhattan distance in the 3D colour space, though this may change in the future.

Example of what the closestDyeColour() method returns - check the item in the top right.

Last updated