ColorStyle

ColorStyle

A reusable color style defined in the project. Supports light and dark theme variants. Color styles let you manage color appearances from one place in a project. In the UI, you can find them in the Assets panel. Plugins can use these styles to do things like sync design systems or check accessibility.

Colors are stored in RGBA format, e.g. rgba(242, 59, 57, 1). The light attribute is the default color used in light theme. The dark attribute is an optional color used in the dark theme.

To organize color styles into folders, use / as a separator in the name, e.g. "My Plugin/My Cool Color".

Methods & Properties

A unique identifier for the color style.

Hierarchical path to the color style in the assets folder structure, e.g. ui/modals/background. Used for organizing color styles in the UI and for programmatic access. Segments are separated by forward slashes.

Color used for the default or light theme in RGBA format, e.g rgba(242, 59, 57, 1)

Optional color used for the dark theme in RGBA format, e.g rgba(242, 59, 57, 1)

Set the attributes of a color style. Attributes are merged with existing values, so only the provided attributes are updated.

Get plugin data for this color style by key.

Set plugin data on this color style by key.

Get all plugin data keys for this color style.

Deletes the color style from the project. You need a reference to the style to call this method.