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
  • 5 years ago

Installs

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

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