Released 09 April, 2019 – read release notes
Daily Sketch 54: All right here's an actual scary monster girl this time. Not like that dumb joke last time. I went with a spooky Frankenstein's Monster-chan. Discover the best UI Kits, Icons, Templates, Mockups, Style Guides, Illustrations, and more free resources for Sketch. Take your Sketch designs to the next level. Use this simple z-Score calculator. Solve for probability, percentile and standard normal distribution curve area. Enter to learn with graphs and plots.
Changes
colors
and gradients
properties have been added on Document and globalAssets
Sketch Nature Water. Linear Plan Robot. Animal Butterflies. Paisley Decorative. Girl Female Drawing. Colored Pencil Pencil. Facebook Logo Face Fb. Sketch Character Funny. Sketch Art Graphic. Sketch Character Funny. Sketch Embroidery Designs, font Sketch Embroidery Designs, robot Sketch Embroidery Designs, holiday Sketch Embroidery Designs, boy Sketch Embroidery Designs, girl Sketch Embroidery Designs, teenager Sketch Embroidery Designs, mom Sketch Embroidery Designs, dad Sketch Embroidery Designs, teacher Sketch Embroidery Designs, school Sketch Embroidery Designs.
GitHub pull request #345 and #398
sketch.globalAssets
property was added- Two new asset types were added
ColorAsset
- name, type: String (can be null)
- color, type: String
GradientAsset
- name, type: String (can be null)
- gradient, type: Gradient
Usage
Setting Global Colors (Be sure to save a copy of your global assets before playing with this!)
Note that this doesn’t work
![Sketch 54.1 Sketch 54.1](https://media.nbcwashington.com/2019/09/Coachella-2019-Weekend-2-Courtesy-of-Coachella-54.jpg?resize=850%2C478)
Other useful actions
Similarily for Gradients
Setting Global Gradients
Similarly, document colors and document gradients can all be found on
Document
Shared styles are now document
properties and can be mutated
Two new properties on
document
(try not to get them mixed up as the styles are subtly different!)sharedLayerStyles
sharedTextStyles
Usage
Setting a Shared Style
layer.index
can now be set
You can set the index of the layer to move it in the hierarchy. Note that you also have
layer.moveToFront()
, layer.moveForward()
, layer.moveToBack()
, and layer.moveBackward()
Usage
aspectRatio
property has been added to Gradient
When the gradient is
Radial
, the from
and to
points makes one axis of the ellipse of the gradient while the aspect ratio determines the length of the orthogonal axis (aspectRatio 1
means that it’s a circle).Usage
selected
property and getFrame
method have been added on an Symbol override
The frame of an override can be different than the frame of its affected Layer in case where the Symbol Instance has been scaled or, in the case of the example below, the text value is changed for the Symbol instance resulting in a shorter frame.
Usage
layer.duplicate
now works on a layer with no parent
Previously you needed to have a parent in order to duplicate the layer. Now you are free to do so without working around this.
Usage
symbolInstance.master
now works on an immutable instance
If you ever got an
MSImmutableSymbolInstance
object and attempted to wrap the native sketch object then you would have previously gotten an error. It has now been fixed.You can now remove flow targets with setting flow
as undefined
on a Layer
Sketch 54 17 Niv
Previously you couldn’t remove a flow target. Now you can!
Usage
pattern
properties have been added to Fill
Previously this also applied to the
noise
property as well but Sketch has depreciated the noise fill option in favor of having the noise patterns be image fills.Usage
An image buffer can now be used with ImageData
This change helps with the next one (Export now returns a buffer if output is false)
export
now returns a Buffer if options.output
is false
and options.formats
is an image format
Sketch 52.6
If you ever wanted to get at the thumbnail preview image data when something is marked for export you can do so with this new API functionality.
See this issue for more info why this was added.
Quick Summary of Sketch’s export options
The method returns Bundle for wedding 1 3.
undefined
ifoptions.output
isundefined
or a string- an array of
Buffer
ifobjectToExport
is an array andoptions.formats
is an image format - an array of
Object
ifobjectToExport
is an array andoptions.formats
is json - a
Buffer
ifobjectToExport
is a single item andoptions.formats
is an image format - an
Object
ifobjectToExport
is a single item andoptions.formats
is json
Usage
getSelectedDocument
will try harder to find your document
If you are using SKPM, SKPM defines
context
as a global so it will prefer to use that first. If there is no current document (via NSDocumentController.sharedDocumentController().currentDocument()
then Sketch will attempt to use NSApplication.sharedApplication().orderedDocuments()
. Ultimately, you don’t really need to know too much about these underlying changes but it is useful to know that .getSelectedDocument()
should work reliabily. If its not, be sure to file an issue.console.clear
will now clear the DevTools console
Simple recorder 1 7 1. Use
console.clear()
to clean up your console.selectedPage
and selectedLayers
can now be set on the Document
Previously these were read-only properties. However, now you can pass in a layer or a page to these objects to set them.
Usage
![Sketch 54.1 Sketch 54.1](https://i.pinimg.com/originals/44/91/45/44914599a79ef36b36ccdffcba112c19.jpg)
Sketch 54 17 Kjv
Add some methods to deal with the Symbols Page
The “Symbols” page is similar to other pages. The only way it is specific is when creating a Symbol, Sketch will ask the user if they want to move it to that page. You can put Symbols in any page but if you want to respect the convention Sketch put in place, here are a few methods to help you do so.
Adds a few methods on
Page
getSymbolsPage(document)
- Returns a Page or
undefined
if there is no Symbols page yet
- Returns a Page or
createSymbolsPage()
- Returns a Page
isSymbolsPage()
- Returns a
boolean
- Returns a
Usage
Note that
.createSymbolsPage()
won’t prevent you from creating multiple pages that are titled “Symbols”.If you have multiple pages with “Symbols” I believe that
.isSymbolsPage()
will only be true for the earliest created page with the title “Symbols”. Under the hood the API is using:Related resources
Sketch 54 17 Commentary
See something wrong or incomplete? Improve this page.