ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

CSS Color Converter

by TheDutchCoder ST2/ST3

A Sublime Text 2 plugin that converts CSS colors from hex to rgb and back

Details

  • 2015.10.12.14.19.17
  • github.​com
  • github.​com
  • 2 years ago
  • 2 hours ago
  • 4 years ago

Installs

  • Total 18K
  • Win 12K
  • OS X 5K
  • Linux 2K
May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14
Windows 3 10 8 12 8 7 9 13 9 7 6 7 9 8 10 14 5 8 9 8 10 12 5 8 7 10 12 16 4 10 3 11 10 9 11 10 10 3 11 17 13 8 6 10 8 9
OS X 1 0 1 1 1 0 1 1 1 1 0 2 0 3 4 3 1 3 1 2 0 3 1 2 4 7 2 0 1 3 2 2 1 4 3 8 3 5 2 2 0 4 2 1 2 3
Linux 0 0 1 0 6 2 0 3 0 1 3 1 2 3 1 1 0 2 1 2 0 2 2 0 0 2 0 1 0 1 1 6 0 0 1 1 1 1 3 0 0 0 0 0 1 3

Readme

Source
raw.​githubusercontent.​com

ColorConvert

A Sublime Text plug-in that converts CSS numerical color values. You can convert any hex, rgb(a) or hsl(a) color in the following sequence: hex -> rgba -> hsla -> hex (etc).

Installation

You can easily install the plug-in through Will Bond's excellent Package Control (https://sublime.wbond.net/). If you want to install this plug-in manually for some reason, simply clone this repo into your packages directory (make sure not to put it in the user sub dir).

Instructions

  1. Select a color declaration (e.g. '#ff0022', 'rgb(120, 0, 12)', or 'hsla(320, 75%, 10%, 0.2)')
  2. Hit ctrl+shift+c by default (cmd+shift+c on Mac OS) to convert to the next type (hex -> rgba -> hsla -> hex -> etc).

Supported Features

  • Convert hex values to rgba
  • Convert rgb(a) values to hsla
  • Convert hsl(a) values to hex
  • Remembers the alpha value of a selection (e.g. when 'rgba(120, 0, 12, 0.2)' is converted to any other value, the '0.2' alpha value will be remembered, even if you convert the value to hex)

Planned Features

  • Convert all colors equal to the selected one in the document (milestone 1.2)

Notes

  1. CSS color names (e.g. 'red', 'transparent', etc) are currently not supported (not planning to unless there's a high demand).
  2. Whenever possible, the plug-in will output the shorthand hex value (e.g. '#000' instead of '#000000').
  3. The output for hsl and alpha channels is in floating point, to ensure a little more accuracy.

Examples

color: rgba(128, 0, 12, 0.5);

Will convert to:

color: hsla(354.4, 100.0%, 25.1%, 0.5);
color: #80000b;
color: rgba(128, 0, 12, 0.5);