New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sketch 53] Document's colors format #154

Open
mathieudutour opened this Issue Dec 14, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@mathieudutour
Copy link

mathieudutour commented Dec 14, 2018

Hello 馃憢

Just wanted to give you a heads up that the format for document colors will change in Sketch 53. There will be a beta soon-ish.

Hopefully the feature the change was made for will make up for the inconvenience :) I'll add more details as soon as we stabilize the API for the beta.

@kdzwinel

This comment has been minimized.

Copy link
Collaborator

kdzwinel commented Dec 14, 2018

Thanks for the heads up! If that will not be too much trouble please ping us when beta that implements those changes will be available for download.

@mathieudutour

This comment has been minimized.

Copy link
Author

mathieudutour commented Dec 19, 2018

There it is: https://www.sketchapp.com/beta/ 馃帀

So now you have document.assets().colorAssets() which is an array of MSColorAsset which itself has a color and name properties.

You might also need the following methods (all on the document.assets() object):

  • Add a document color: - (void)addAsset:(nonnull id<MSAsset>)asset withName:(nullable NSString *)name;
  • you can only update the name, not the color: - (void)setName:(nullable NSString *)name forAssetAtIndex:(NSUInteger)index ofType:(MSAsset)type;
  • and remove an asset: - (void)removeAssetAtIndex:(NSUInteger)index ofType:(MSAsset)type;

The type can be either MSAssetColor or MSAssetGradient or MSAssetImage or MSAssetExportPreset (the last 2 don't have names)

@burakukula

This comment has been minimized.

Copy link
Contributor

burakukula commented Jan 30, 2019

Hey @mathieudutour! Thanks a lot for the info 馃憣, we will have a look into it 馃檪

@burakukula burakukula self-assigned this Jan 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment