Skip to content

Dynamic RGBA

Provides an RGBA color (which is then converted to ARGB) using float providers.

Type ID: kaya:dynamic/rgba

Format

Field Type Default Description
red Float Provider The red component of the color. The value is clamped from 0.0 to 1.0.
green Float Provider The green component of the color. The value is clamped from 0.0 to 1.0.
blue Float Provider The blue component of the color. The value is clamped from 0.0 to 1.0.
alpha Float Provider The alpha (transparency) component of the color. The value is clamped from 0.0 to 1.0.

Example

{
    "type": "kaya:dynamic/rgba",
    "red": {
        "type": "kaya:linear_interpolated",
        "delta": {
            "type": "kaya:product",
            "values": [
                {
                    "type": "kaya:vector/length",
                    "vector": {
                        "type": "kaya:entity/velocity",
                        "entity": "this"
                    }
                },
                3.5
            ]
        },
        "start": 1.0,
        "end": 0.0
    },
    "green": 1.0,
    "blue": 1.0,
    "alpha": 1.0
}

This example provides an RGBA color with its red component being dependent on the entity's velocity magnitude. The faster the entity's velocity, the less red it becomes.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.