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

Color​Picker

by Weslly H. ALL Trending Top 25

A multi-platform color picker plugin

Labels css

Details

Installs

  • Total 1.48M
  • Win 1.08M
  • Mac 214K
  • Linux 188K
Aug 28 Aug 27 Aug 26 Aug 25 Aug 24 Aug 23 Aug 22 Aug 21 Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 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
Windows 6 98 61 34 39 48 63 44 53 36 37 45 47 44 51 110 43 37 36 44 53 44 71 43 34 29 42 51 34 27 47 34 26 31 44 55 32 48 35 23 33 52 46 32 32 28
Mac 1 4 10 2 4 5 2 3 6 1 8 2 8 3 4 7 5 6 1 8 4 7 4 6 3 4 4 2 9 3 4 1 2 5 8 7 3 4 5 2 4 7 2 5 6 5
Linux 1 3 4 2 6 7 4 7 10 5 6 7 2 10 5 9 2 5 4 3 6 7 5 4 3 8 2 7 9 5 3 8 12 12 6 9 1 7 7 1 2 5 8 6 6 10

Readme

Source
raw.​githubusercontent.​com

Mac OSX

Linux

Windows

Installation

Install this repository via Package Control.

Usage

To insert or change a selected color, use:

  • Linux: ctrl+shift+c
  • Windows: ctrl+shift+c
  • OS X: cmd+shift+c

or use menu action

  • Tools** -> **ColorPicker

By default, the hex color code is inserted using uppercase letters. To use lowercase letters instead, copy the contents of **Preferences -> Package Settings -> ColorPicker -> Settings-Default** to the empty file created by selecting **Preferences -> Package Settings -> ColorPicker -> Settings-User**, then change "color_upper_case" to false.

Calling from Other Plugins

To commands are provided to assist in calling a color picker from other plugins. Info is shared between the plugins via a settings file. It does not have to exist on disk; it can exist only in memory for the sole purpose of sharing the return. It is advised to use a unique name for the settings file. The data is returned in the settings key color_pick_return. It is advised to set color_pick_return to None in your settings file before calling any of the commands. So you can tell if it set teh variable or not.

ColorPickApiIsAvailableCommand

This command is used to test if ColorPicker is installed.

>> settings = sublime.load_settings('my_shared.sublime-settings')
>> settings.set('color_pick_return', None)
>> sublime.run_command('color_pick_api_is_available', {'settings': 'my_shared.sublime-settings'})
>> print(settings.get('color_pick_return'))
True

ColorPickApiGetColorCommand

This command is used to call a color picker and get the selected value. It takes a setings file and an optional default_color.

>> settings = sublime.load_settings('my_shared.sublime-settings')
>> settings.set('color_pick_return', None)
>> sublime.run_command('color_pick_api_get_color', {'settings': 'my_shared.sublime-settings', 'default_color': '#ff0000'})
>> print(settings.get('color_pick_return'))
#23af44

Acknowledgements