Fork me on GitHub

CT

Color Tools

A small collections of Advanced Sass color tools.

CT-hsl function

If you've used the hsl function built into Sass you'll know that Sass converts values to hex, and the hsla function converts values to rgba. What if you wanted to keep them as hsl/hsla? This function allows you to pass either hex values or hsl values through it and it convert/preserve the values. If you pass the function another argument $alpha, you can create hsla values. Below are some examples:

   Input                       -> Output
   ct-hsl(red);                -> hsl(0, 100%, 50%);
   ct-hsl(#b4d455)             -> hsl(75.11811, 59.62441%, 58.23529%);
   ct-hsl(blue,0.7)            -> hsla(240, 100%, 50%,0.7);
   ct-hsl(90deg 42% 76%, 0.6)  -> hsla(90, 42%, 76%,0.6);
   ct-hsl(50 50 50, 0.6)       -> hsla(50, 50%, 50%,0.6);  

CT-pallet function

Use this function to create a list or nested list of colors to use in your site, just specify a color and a pallete will be generated, list of arguments below:

Mono Scheme

  ct-pallet(#ff0d00) ->  #ff0d00, #ff4940, #ff7a73, #a60800;

Complementary Scheme

  ct-pallet(#9b59b6, comp) -> #9b59b6, #bb8ecd, #d0b2dd, #589240;

Triadic Scheme

  ct-pallet(#9b59b6, triad) -> #9b59b6, #bb8ecd, #d0b2dd, #589240;

Color Names

  ct-pallet(#e67e22, mono, true) ->
  alpha #e67e22, beta #eea767, gamma #f3c195, delta #9f5412;