Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Compass plugin which uses Sass color functions to hack color relationships.

branch: master

first commit

latest commit af1e660a64
Brandon Mathis authored November 05, 2011
Octocat-spinner-32 lib first commit November 05, 2011
Octocat-spinner-32 stylesheets first commit November 05, 2011
Octocat-spinner-32 .gitignore first commit November 05, 2011
Octocat-spinner-32 Gemfile first commit November 05, 2011
Octocat-spinner-32 LICENSE.markdown first commit November 05, 2011
Octocat-spinner-32 README.markdown first commit November 05, 2011
Octocat-spinner-32 VERSION.yml first commit November 05, 2011
Octocat-spinner-32 color-hacker.gemspec first commit November 05, 2011
README.markdown

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.

Something went wrong with that request. Please try again.