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

CSS Color Converter

by TheDutchCoder ALL

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
  • 9 years ago
  • 36 minutes ago
  • 12 years ago

Installs

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

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