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

Color​Picker

by Weslly H. ST2/ST3 Top 25

A multi-platform color picker plugin

Labels css

Details

Installs

  • Total 1.03M
  • Win 705K
  • OS X 178K
  • Linux 144K
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 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3
Windows 325 448 522 556 219 0 22 563 553 578 558 372 402 456 492 421 228 257 284 335 389 428 428 324 358 339 359 483 493 474 560 512 353 371 536 571 518 478 500 353 368 480 494 527 504 541
OS X 34 69 70 76 28 0 5 65 58 57 76 41 37 58 62 55 29 26 27 29 49 32 30 42 58 36 38 54 49 58 58 44 41 51 49 65 59 51 65 40 39 47 62 88 71 68
Linux 38 75 91 55 43 0 2 71 71 70 51 49 46 53 67 52 34 35 44 51 45 59 52 46 54 52 51 61 75 54 56 65 43 45 71 67 67 67 55 59 54 59 63 59 82 76

Readme

Source
raw.​githubusercontent.​com

Mac OSX

Linux

Windows

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

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