Skip to content

Instantly share code, notes, and snippets.

View dannyweilai's full-sized avatar

Danny Lai dannyweilai

  • Singapore <-> Vancouver
View GitHub Profile
@dannyweilai
dannyweilai / getCanvasColor.js
Created February 14, 2018 16:31
Midnight - get canvas color
if(NSClassFromString("DLMidnightTheme")) {
const current = DLMidnightTheme.currentTheme()
const canvasColor = current.activeCanvasColor()
log("Canvas Color: " + canvasColor)
log("SVG Rep:" + DLMidnightUtils.hexFromColor(canvasColor))
}
@dannyweilai
dannyweilai / getThemeID.js
Created February 2, 2018 02:47
Midnight - get theme id
if(NSClassFromString("DLMidnightTheme")) {
const current = DLMidnightTheme.currentTheme()
const themeID = current.themeID()
log("Current theme ID: " + themeID)
// if themeID == "original" means it is Sketch default theme
}