Project

tinge

0.01
No commit activity in last 3 years
No release in over 3 years
Extract color information into various formats from CSS/SCSS files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 0

Runtime

>= 0
~> 3.3.0.rc.2
>= 0
 Project Readme

Tinge

Extract color information from CSS/SCSS files (for various formats).

Usage

You can see usage information by running tinge help.

Currently the only available operation is extracting color variable assignments from SCSS files and outputting them to various formats:

  • ASE (Adobe Swatch Exchange)
  • SCSS (but with all variable assignments and functions resolved)
  • JSON
  • Ruby
  • YAML

This command is executed as tinge vars, although since it's the default, vars can be omitted (as is in the examples below):

As an example, using this simple SCSS file:

$ cat colors.scss
$white: white;
$gray: darken($white, 85%);
$orange: #fab444;

We can get the final (resolved) SCSS:

$ tinge colors.scss
$gray: #262626;
$orange: #fab444;
$white: #ffffff;

Convert it to a JSON object suitable for use in JavaScript:

$ tinge -f json colors.scss
{"white":"#ffffff","gray":"#262626","orange":"#fab444"}

Output it as YAML (and note tinge accepts stdin, too):

$ cat colors.scss | tinge -f yml
---
gray: "#262626"
orange: "#fab444"
white: "#ffffff"

We can also create an ASE file (note --output/-o is required):

$ tinge -f ase colors.scss -o colors.ase

Contributing

  1. Fork it: http://github.com/bruce/tinge/fork
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request