Skip to content

Colour Predicate Format

ioblackshaw edited this page Jun 23, 2025 · 7 revisions

Colour Predicates

Colour Predicates are used in some tests in the when part of a Colour Override Definition. They can be used for more powerful colour checks such as; matching against a range of colours, matching against sign text colours, etc.

Below is an example of the sign_dye colour predicate specified as the color test in the when part:

"color": {
    "type": "eg_text_customiser:sign_dye",
    "dye": "orange"
}

Colour Predicates are defined with a type field, alongside additional properties specified by the predicate type

JSON Format

The following tests can be specified in the when part

Field Format Examples Notes
type The resource location of a colour predicate type "eg_text_customiser:sign_dye", "eg_text_customiser:simple"
<type specific fields> Additional fields specified by the colour predicate type

Colour Predicate Types

Below are all the currently supported colour predicate types

eg_text_customiser:simple

Performs a simple equality check on a colour

JSON Format

Additional Fields Format Examples Notes
value A hexadecimal colour string, RGB integer list in 0-255 range, or Named colour "#ff00ff" [255,128,0] "red"