# Colored Items

{% hint style="warning" %}
This requires ItemsAdder 4.0.13 and Minecraft 1.21.4+ (both client and server).
{% endhint %}

To create a colored item you have to use a base texture, for example something like the quartz texture: `minecraft:item/quartz`.\
You can use any texture you want, in this case I use the quartz texture as it's white and already included in the game files.

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-af8093a81ab6a1088af7b5f73b1e71ca5a6663a9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Then specify the `color` attribute in the `graphics` properties. In this case I use `RED`.

It accepts the following format:

* `RED` (Bukkit `Color` enum)
* `#FFFFF` (Hexadecimal) (`#` is optional)
* `13083194` (Decimal)
* `255, 255, 255` (RGB)

```yaml
info:
  namespace: test
items:
  test_dyeable:
    name: Test Dyeable
    graphics:
      texture: minecraft:item/quartz
      color: RED
      hand_animation_on_swap: true
```

<figure><img src="https://708574821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M28TcKgSDvuFN510qye-887967055%2Fuploads%2Fgit-blob-2c8e7781ca26d08e45f67a88e6afb3906a088588%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Chaging color during gameplay

You can change colors using the command `/iacolor <color>`.

### Templates and variants

You can create variants of the base item to make various variants of the same item but with different color.

Mark the base item as `template: true` then reference it using `variant_of: xxx` in the other items.

#### Example

```yaml
  test_dyeable_template:
    name: Test Dyeable
    template: true
    graphics:
      texture: minecraft:item/quartz
      color: RED
      hand_animation_on_swap: true
  test_dyeable2:
    name: Test Dyeable 2
    variant_of: test_dyeable_template
    graphics:
      color: BLUE
  test_dyeable3:
    name: Test Dyeable 3
    variant_of: test_dyeable_template
    graphics:
      color: "#326da8"
  test_dyeable4:
    name: Test Dyeable 4
    variant_of: test_dyeable_template
    graphics:
      color: 255,0,0
```
