Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Sketch palette #104

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/colors.sketchpalette
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"compatibleVersion":"1.4","pluginVersion":"1.4","colors":[{"red":0,"green":0.12156862745098039,"blue":0.24705882352941178,"alpha":1},{"red":0,"green":0.4549019607843137,"blue":0.8509803921568627,"alpha":1},{"red":0.4980392156862745,"green":0.8588235294117647,"blue":1,"alpha":1},{"red":0.2235294117647059,"green":0.8,"blue":0.8,"alpha":1},{"red":0.23921568627450981,"green":0.6,"blue":0.4392156862745098,"alpha":1},{"red":0.1803921568627451,"green":0.8,"blue":0.25098039215686274,"alpha":1},{"red":0.00392156862745098,"green":1,"blue":0.4392156862745098,"alpha":1},{"red":1,"green":0.8627450980392157,"blue":0,"alpha":1},{"red":1,"green":0.5215686274509804,"blue":0.10588235294117647,"alpha":1},{"red":1,"green":0.2549019607843137,"blue":0.21176470588235294,"alpha":1},{"red":0.5215686274509804,"green":0.0784313725490196,"blue":0.29411764705882354,"alpha":1},{"red":0.9411764705882353,"green":0.07058823529411765,"blue":0.7450980392156863,"alpha":1},{"red":0.6941176470588235,"green":0.050980392156862744,"blue":0.788235294117647,"alpha":1},{"red":0.06666666666666667,"green":0.06666666666666667,"blue":0.06666666666666667,"alpha":1},{"red":0.6666666666666666,"green":0.6666666666666666,"blue":0.6666666666666666,"alpha":1},{"red":0.8666666666666667,"green":0.8666666666666667,"blue":0.8666666666666667,"alpha":1}]}
26 changes: 26 additions & 0 deletions bin/create-sketch-palette
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env node

var fs = require('fs');
var path = require('path');
var hexRgb = require('hex-rgb');
var colors = require('../js/colors');

var order = ['navy', 'blue', 'aqua', 'teal', 'olive', 'green', 'lime', 'yellow',
'orange', 'red', 'maroon', 'fuchsia', 'purple', 'black', 'gray', 'silver'];

var palette = {
compatibleVersion: '1.4',
pluginVersion: '1.4',
colors: order.map(function(name) {
var rgb = hexRgb(colors[name]);
return {
red: rgb[0] / 255,
green: rgb[1] / 255,
blue: rgb[2] / 255,
alpha: 1
};
})
}

var filePath = path.join(__dirname, '..', 'assets', 'colors.sketchpalette');
fs.writeFileSync(filePath, JSON.stringify(palette), 'utf8');
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"oocss"
],
"devDependencies": {
"tachyons-cli": "^0.3.1"
"tachyons-cli": "^0.3.1",
"hex-rgb": "^1.0.0"
},
"repository": {
"type": "git",
Expand Down