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
  • 1 year ago
  • 9 minutes ago
  • 4 years ago

Installs

  • Total 17K
  • Win 11K
  • OS X 4K
  • Linux 2K
Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 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
Windows 0 5 19 8 10 13 10 24 9 11 8 16 11 7 23 8 18 12 24 15 10 14 11 15 15 11 14 27 11 7 19 11 14 10 9 5 11 10 16 14 13 8 14 13 7 9
OS X 0 0 1 4 2 1 2 3 4 4 3 4 3 1 8 1 2 3 5 4 8 3 1 2 1 2 4 2 1 8 2 5 2 1 4 1 1 0 7 0 4 3 1 4 2 1
Linux 0 2 0 1 2 2 0 2 2 1 2 4 2 0 3 1 1 3 3 2 1 1 1 1 3 1 3 2 2 5 3 0 2 2 1 0 1 3 1 2 1 0 2 6 1 2

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);