• Stars
    star
    381
  • Rank 112,502 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 13 years ago
  • Updated about 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A most excellent HSL color picker

What's so great about HSL

HSL (Hue, Saturation, Luminosity) allows us to describe meaningful relationships between colors. Give this brown color, hsl(36, 73%, 10%), it's clear that if we desaturate 40 steps and lighten 70 steps we get hsl(36, 33%, 80%), a cream color. Look at that in hex, #2C1D07 to #DDCFBB, or in rgb, rgb(44, 29, 7) to rgb(221, 207, 187), and the relationship between colors isn't evident in any meaningful way.

I use Compass and Sass for all of my web design work and there are great color functions that allow me to manipulate colors using these relationships. I can use Sass's adjust-color to convert brown to cream like in the example above.

adjust-color(#2C1D07, $saturation: -40%, $lightness: 70%)
//returns #DDCFBB

Sass converts easily between rgb, hsl, and hex so I can have convenience of HSL color relationships but the browser compatibility of hex color notation. There are other color functions like change-color which lets you set the properties of a color, and scale-color which applies color transformations on a relative scale. These are great, but because they work like HSL, you have to understand how HSL works.

HSB != HSL

In graphics software I pick colors in HSB (Hue, Saturation, Brightness) because it feels more natural to work with than RGB or CMYK. Now, with CSS3 we can use HSL which is actually quite different than HSB. Without a decent HSL color picker, it's difficult to understand.

How to think in HSL

Pick a Hue from 0 to 360 and with saturation at 100 and lightness at 50 and you'll have the purest form of that color. Reduce the saturation and you move towards gray. Increasing the brightness moves you towards white, decreasing it moves you towards black.

License

Copyright (c) 2011 Brandon Mathis

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
Ruby
9,318
star
2

fancy-buttons

Fancy CSS Buttons using Compass
Ruby
819
star
3

color-hacker

A Compass plugin which uses Sass color functions to hack color relationships.
Ruby
64
star
4

guard-jekyll-plus

A Guard plugin for smarter Jekyll builds
Ruby
63
star
5

jekyll-liquid-plus

Super powered Liquid tags for smarter Jekyll templating.
Ruby
53
star
6

wp-life

Ultra minimal WordPress theme using layouts and partials, Compass and Sass, rsync for deployment, and HTML5 video with flash backup.
JavaScript
39
star
7

jekyll-markdown-block

Embed markdown anywhere in Jekyll.
Ruby
31
star
8

design-enthusiast

The source code to generate and deploy brandonmathis.com
Ruby
27
star
9

esvg

A tool for embedding svg icons in Rails or stand-alone apps.
Ruby
16
star
10

adn-timeline

A javascript timeline fetcher for App.net
JavaScript
16
star
11

staticmatic-starter

This is how I start a new project with StaticMatic (includes Compass and fancy-buttons)
Ruby
11
star
12

fancy-avatars

Fancy avatars intended for use in applications as the default avatar. Gender specific avatars are included
7
star
13

jekyll-stitch-plus

A Jekyll plugin for compiling javascripts with Stitch Plus
Ruby
6
star
14

clubset

ClubSet is a simple card game inspired by the classic pattern matching game "Set."
JavaScript
4
star
15

nice-buttons

A Compass extension for Nice and easy CSS3 buttons.
Ruby
4
star
16

stitch-plus

A nicer way to combine and uglify javascript with fingerprinting and modularization. Powered by Stitch.
Ruby
3
star
17

hoodis

A simple personality test powered by Backbone.js and coffeescript.
JavaScript
3
star
18

TextMate-imathis-theme

A dark theme for TextMate that does a nice job with Haml and Scss highlighting.
2
star
19

desoto-photoapp

A system for automating the photo system at DeSoto Caverns
Ruby
2
star
20

imathis.github.com

A clone of http://brandonmathis.com for testing octopress with GitHub pages.
2
star
21

wordrush

A game in rails
Ruby
1
star
22

forestry-demo

HTML
1
star
23

guard-stitch-plus

A Guard plugin for concatenating and modularizing javascript with Stitch-rb
Ruby
1
star