Hex to HSL Color Converter
Sublime Text 2/3 plugin to convert CSS Hex colors to HSL.
Details
Installs
- Total 24K
- Win 17K
- Mac 5K
- Linux 2K
Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 1 | 0 | 0 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
About
Adds commands to Sublime Text that converts RGB colors, in either hex or RGB() format, to HSL colors. For example:
#bada55
becomeshsl(74, 64%, 59%)
rgb(75, 96, 6)
becomeshsl(74, 88%, 20%)
rgba(117, 149, 9, 0.65)
becomeshsla(74, 89%, 31%, 0.65)
In the past, due to browser (IE) compatibility, it was best to use a CSS preprocessor to convert the HSL colors to hex. But now all major browsers support HSL color, including IE9+, so you can use HSL colors in CSS unless you need to support IE8.
Installation
You can install using Package Control or you can download or clone the repository and drop it into your Sublime Text packages directory.
Version 2 Features
- Version 2 now converts hex and RGB to HSL and RGBA to HSLA. The previous version only converted hex to HSL.
- Optionally, you can convert hex, RGB, and RGBA to HSLA (force alpha).
- You can now convert all hex, RGB, and RGBA colors in a file by inputting the following command twice: (
shift+ctrl+U
).
Usage
- Convert Selected to HSL: shift+ctrl+U
- Convert Selected to HSLA: shift+ctrl+alt+U
- Convert All to HSL (preserving alpha): shift+ctrl+U + shift+ctrl+U
- Convert All to HSLA (force alpha): shift+ctrl+alt+U + shift+ctrl+alt+U
Why No Hex/HSL to RGB support
HSL color is just better than hex or RGB (Brandon Mathis gives a good explanation why HSL rocks). I don't see any use for RGB—HSL is just more intuitive and makes it much easier to combine colors into a logical color scheme.
If you have the need to convert to RGB, you might try the CSS Color Converter plugin.
HSL Resources
If you need more convincing about HSL, try these:
- W3: HSL Colors
- HSL Color Picker
- An Easy Guide To HSL Color In CSS3
- Three Ways You Should Be Using HSL Color In Your Site Today
- Color in Opera 10 — HSL, RGB and Alpha Transparency
- HSL Color Wheel Demo
- Paul Irish's Mother-effing HSL
- Coding Colors Easily Using CSS3 hsl() Notation
- Treehouse Quick Tip: HSLa Color Values in CSS