Skip to content

Feature: add support for Color Variables (Swatches) #141

@lindsayevans

Description

@lindsayevans

I'm currently working on an implementation of this, but would appreciate any feedback before I go too far down the rabbit hole :)

Example usage:

const red = new Swatch({
    name: 'Primary/Red',
    color: new Color('#c00')
});
sketch.addSwatch(red);

Then use the Swatch anywhere you'd normally use a Color:

artboard.addLayer(new Rectangle({
    width: 100,
    height: 100,
    x: 10,
    y: 10,
    name: 'Red Box',
    style: {
        fills: [
            {
                color: red,
            },
        ],
    },
}));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions