Schemas / Geometry / paint

rig.paint.gradient

v0.31.0 · draft 4 fields 2 required

Fields

FieldTypeMeaning
kind enumlinear · radial required linear, radial
stops array<object> required Sorted t in 0-1
start vec2 optional Optional. Start / center; absent = (0, 0) in object space
end vec2 optional Optional. End / radius hint; absent = (1, 0) in object space

Shared gradient paint (optional library entity).

JSON Schema

Resolves at https://rig.works/schemas/rig.paint.gradient.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.paint.gradient.schema.json",
  "title": "rig.paint.gradient",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "linear",
        "radial"
      ]
    },
    "stops": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "t",
          "rgba"
        ],
        "properties": {
          "t": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "rgba": {
            "$ref": "./_defs.schema.json#/$defs/rgba"
          }
        }
      }
    },
    "start": {
      "$ref": "./_defs.schema.json#/$defs/vec2"
    },
    "end": {
      "$ref": "./_defs.schema.json#/$defs/vec2"
    }
  },
  "required": [
    "kind",
    "stops"
  ]
}