{"size": 630, "ext": "js", "max_stars_repo_path": "cli/packages/themer-sketch-palettes/lib/index.js", "max_stars_repo_name": "mariam1019/themer", "max_stars_repo_stars_event_min_datetime": "2019-06-20T17:27:15.000Z", "max_stars_repo_stars_event_max_datetime": "2019-06-20T17:27:15.000Z", "max_issues_repo_path": "cli/packages/themer-sketch-palettes/lib/index.js", "max_issues_repo_name": "mariam1019/themer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "cli/packages/themer-sketch-palettes/lib/index.js", "max_forks_repo_name": "mariam1019/themer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.25, "max_line_length": 59, "alphanum_fraction": 0.4904761905}
const one = require('onecolor');

module.exports.render = colors =>
  Object.entries(colors).map(([name, colorSet]) =>
    Promise.resolve({
      name: `themer-sketch-palettes-${name}.sketchpalette`,
      contents: Buffer.from(
        JSON.stringify({
          compatibleVersion: '2.0',
          pluginVersion: '2.13',
          colors: Object.values(colorSet).map(color => ({
            red: one(color).r(),
            green: one(color).g(),
            blue: one(color).b(),
            alpha: one(color).a(),
          })),
          gradients: [],
          images: [],
        }),
        'utf8',
      ),
    })
  );
