Skip to content

A SketchApp plugin that generates Swift Color Theme files from your Sketch documents.

Notifications You must be signed in to change notification settings

nahitheper/SwiftColorPalette

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swift Color Palette

A SketchApp plugin that making color palette an enum in other words generates Swift Color Theme files from your Sketch documents.

Swift Color Palette plugin inspired by @NatashaTheRobot 's blog post

Installation

Download and extract the contents of this repository. Then double-click the SwiftColorPalette.sketchplugin bundle to install the plugin. In Sketch Toolbox, search for 'Swift Color Palette' and tap Install.

Short Demo

Swift Color Palette

Usage

  • Rename color palette layer(s)
  • Select a layer(s)
  • Run using Plugins > Menu > Swift Color Palette
  • Select a Export File (optional) or you can choose copy to clipboard.
  • Click OK.

Example Code

enum ColorPalette {
    static let lightGrayColor =  UIColor(red:0.737, green: 0.769, blue: 0.792, alpha: 1.000)
    static let blueColor =  UIColor(red:0.353, green: 0.510, blue: 0.647, alpha: 1.000)
    static let grayColor =  UIColor(red:0.373, green: 0.373, blue: 0.376, alpha: 1.000)
    static let panelColor =  UIColor(red:0.212, green: 0.227, blue: 0.267, alpha: 1.000)
    static let secondaryColor =  UIColor(red:0.141, green: 0.220, blue: 0.282, alpha: 1.000)
    static let primaryColor =  UIColor(red:0.129, green: 0.133, blue: 0.145, alpha: 1.000)
}

Feedback

If you have any questions, find a bug, or have ideas for ways to improve the plugin, ping me on twitter: @nahitheper

About

A SketchApp plugin that generates Swift Color Theme files from your Sketch documents.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages