这是indexloc提供的服务,不要输入任何密码
Skip to content

Color: Allow Aliases to be used for colorSpace, components, and alpha values #271

@michaelurban

Description

@michaelurban

Example:

{
  "primitive": {
    "colors": {
      "$type": "oklchComponents|colorComponents",
      "oklch": {
        "black": [0, 0, 0],
        "white": [1, 0, 0]
      }
    }
  },
  "semantic": {
    "state": {
      "none": 0,
      "hover": 0.06,
      "drag": 0.09
    },
    "color": {
      "$type": "color",
      "$colorSpace": "oklch", // <- Nice to have, colorSpace to all colors
      "$alpha": <alpha value|alias>, // <- Nice to have, apply alpha to all colors
      "$components": <alpha value|alias>, // <- Nice to have, apply components to all colors
      "overlay": {
        "primary": {
          "hover": {
            "$value": {
              "components": "{primitive.colors.white.oklch}", // <-!!! Allow alias for components value
              "alpha": "{semantic.state.hover}" // <-!!! Allow alias for alpha value
            }
          },
          "drag": {
            "$value": {
              "components": "{primitive.colors.white.oklch}",
              "alpha": "{semantic.state.drag}"
            }
          }
        },
        "secondary": {
          "hover": {
            "$value": {
              "components": "{primitive.colors.black.oklch}",
              "alpha": "{semantic.state.hover}"
            }
          },
          "drag": {
            "$value": {
              "components": "{primitive.colors.black.oklch}",
              "alpha": "{semantic.state.drag}"
            }
          }
        }
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions