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
  • 4 years ago
  • 3 hours ago
  • 7 years ago

Installs

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