0.02
No commit activity in last 3 years
No release in over 3 years
Color Hacker is a Compass plugin which uses Sass color functions to find find the relationships between colors
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.11
 Project Readme

What is this?

Color Hacker is a handy little utility for helping you crack your color schemes using Sass color functions. Simply pass the hack-colors function a list of colors and it will return a set of color functions that show how all of the colors in the color scheme can be derived from the first color.

Example

@debug(hack-colors(#cff09e #a8dba8 #79bd9a #3b8686 #0b486b));

Output:

$key: #cff09e;
$color-2: scale-color(adjust-hue($key, 36deg), $saturation: -43.367%, $lightness: -2.764%);
$color-3: scale-color(adjust-hue($key, 65deg), $saturation: -53.561%, $lightness: -22.111%);
$color-4: scale-color(adjust-hue($key, 96deg), $saturation: -46.923%, $lightness: -51.508%);
$color-5: scale-color(adjust-hue($key, 118deg), $saturation: 30.395%, $lightness: -70.352%);

Setup

Install the plugin:

gem install color-hacker

Add Color Hacker to your compass configuration file:

require 'color-hacker'

Usage

hack-colors accepts two variables.

  1. A space separated list of colors, e.g. (#fab #00face)
  2. Optional: A function type, scale or adjust. Defaults to scale.
// Debug passes output to the terminal
@debug(hack-colors(#beaf0c #deac0b));

// Return adjust-color functions
@debug(hack-colors(#beaf0c #deac0b, scale));

License

Copyright (c) 2008-2009 Brandon Mathis
All Rights Reserved.
Released under a slightly modified MIT License.