> For the complete documentation index, see [llms.txt](https://docs.jackf.red/jackfredlib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jackf.red/jackfredlib/jackfredlib-colour/colours.md).

# Colours

red.jackf.jackfredlib.api.colour.Colour

`Colour`s 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](https://en.wikipedia.org/wiki/HSL_and_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.

<figure><img src="https://2232534258-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz8jNwd4pzhvQ5ZoPB1s3%2Fuploads%2FM7jKDVuY9akK6omBAYM9%2FjKpxBGIxPC.gif?alt=media&amp;token=51a29606-4249-4b98-9610-7cc8ca7d19d2" alt=""><figcaption><p>Example of what the <code>closestDyeColour()</code> method returns - check the item in the top right.</p></figcaption></figure>
