# Colours

`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="/files/WQzSXujyRZGhkFofa4PU" alt=""><figcaption><p>Example of what the <code>closestDyeColour()</code> method returns - check the item in the top right.</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jackf.red/jackfredlib/jackfredlib-colour/colours.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
