← back to roto on ba3a.dev

VariantOf

@Serializable
data class VariantOf(val base: String, val swaps: List<RampSwapPair>, val outline: @Serializable(with = HexColorSerializer::class) Int? = null)

A profile with no clips of its own: it publishes the finished art of the base profile with some ramps swapped for others. Stored as variant in the variant's profile.json.

Construction checks what needs nothing else; check checks the rest against the project and the base profile.

Constructors

Link copied to clipboard
constructor(base: String, swaps: List<RampSwapPair>, outline: @Serializable(with = HexColorSerializer::class) Int? = null)

Properties

Link copied to clipboard

the id of the profile whose art is recoloured

Link copied to clipboard
val outline: @Serializable(with = HexColorSerializer::class) Int?

the palette colour the outline becomes, or null to keep it

Link copied to clipboard

the ramp swaps, each source ramp once

Functions

Link copied to clipboard
fun check(colours: ProjectPalette, base: Profile?)

Checks this variant against the project's colours and the base profile as loaded, null when there is none: the base must exist and not be a variant itself, every swapped ramp must be in ramps.json and the outline colour in the palette. Throws IllegalArgumentException naming the field.

Link copied to clipboard
fun checkBase(base: Profile?)

Checks only base: it must exist, in this project, and must not be a variant itself.