43

I need a small tool to ‘pick’ a colour anywhere on the screen (so that I basically get the hex code for it). Earlier, I've used KDE's KColorChooser for this.

According to this page, "Gpick" sounds like what I want, but:

$ apt-cache search gpick
<returns nothing>

Any recommendations?

10 Answers 10

42

gpick

That's strange that you couldn't install gpick, as I get the following :

apt-cache search gpick
gpick - advanced GTK+ color picker

I suppose it could be in a source that you currently don't have enabled..

To pick a colour, launch Gpick, lcick on the swatch, and then press space when your mouse hovers over the colour you want to record.

enter image description here

gcolor2

(not anymore available in Ubuntu 19.04+)

That being said for simple colour picking I prefer gcolor2 - Nice and simple to use and should do exactly what you require.

You can install it with following command:

sudo apt-get install gcolor2

gcolor3

gcolor2 is not on the Ubuntu repositories anymore, and has been replaced with gcolor3.

gcolor3

You can install it with following command:

sudo apt-get install gcolor3
4
  • 2
    Thanks! Hmm, looking around at packages.ubuntu.com, it seems gpick just isn't available for 11.04 (Natty). However, gcolor2 does exactly what I want, so I won't investigate the gpick issue further :)
    – Jonik
    Nov 23, 2011 at 16:34
  • 1
    It is a shame gcolor2 is not in the repositories in Ubuntu 19.04! May 9, 2019 at 0:13
  • 1
    gpick is in the repositories for Ubuntu 20.04 , but not gcolor2
    – Flimm
    Jan 20, 2021 at 9:23
  • 2
    Both programs do not work on Wayland Mar 22, 2022 at 10:19
14

I like to use the software agave. It's a simple software that gives your color combinations, and it has a color picker.

sudo apt-get install agave

Worth give it a try!

Regards

2
  • 1
    +1. Agave does this too, and it seems to use the exact same component that is basically the gcolor2 tool. (I'm accepting gcolor2 because it's a nice minimal solution, giving this functionality and nothing else.)
    – Jonik
    Nov 23, 2011 at 16:29
  • 3
    Agave is no longer available. It has been discontinued and removed from the official repositories.
    – Flux
    Jul 13, 2019 at 1:45
9

grabc is as simple as it can get. Spawns a cursor, outputs color on stdout when you click. Pure Unix way.

$ grabc
#f47276
244,114,118

To install it, run sudo apt install grabc.

2
  • 2
    awesome. just setting up a keyboard shortcut for grabc | xclip -i
    – hwjp
    Aug 28, 2018 at 17:14
  • 1
    This one is available in the Ubuntu 20.04 repositories.
    – Flimm
    Jan 20, 2021 at 9:24
3

There's a native color picker for HTML5's <input> tag built into all modern browsers (some screenshots).

Enter this in browser's URL bar:

data:text/html,<input type="color" />

and click on the rendered button. Bookmark for later use. Works offline.

(Technically, this is neither a dedicated app, nor GNOME-specific; which might exactly be the point: no install needed)

1

If it wasn't mention, gcolor2 can also sample color from all over the desktop.

But I got curious about gpick, and tried to install a newer version on Ubuntu 11.04 Natty. So I got:

  • liblua5.2-0_5.2.0-2_i386.deb for precise (there's no earlier); installs in natty via GDebi Package Installer
  • gpick_0.2.5-1_i386.deb from their code.google.com website; installs in natty via GDebi Package Installer (with previous dependency installed)

... however, at this point:

$ gpick 
gpick: /usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by gpick)

Then I tried getting libstdc++6_4.6.3-1ubuntu5_i386.deb and extracting (not installing) it; and using this:

$ LD_LIBRARY_PATH=/home/user/Desktop/libstdc++6_4.6.3-1ubuntu5_i386/usr/lib/i386-linux-gnu gpick
gpick: symbol lookup error: gpick: undefined symbol: g_dbus_object_manager_server_new

... damn, so it needs more dependencies satisfaction (and if one starts messing with libc, one may as well update the OS :) )

Anyways, back to gpicks webpage, there is a link PPA at Launchpad there - so I got gpick_0.2.0-1~ppakarmic1_i386.deb from the PPA Packages ... page. Installed it again via GDebi Package installer (removing the previous, newer one first, with sudo dpkg -r gpick) - and it works! And even if it's not the latest version, I think it looks quite awesome.

1

Here is the X11 native solution that

  • doesn't require any external packages like Agave, Gpick, or Grabc etc (like all existing solutions).
  • and it doesn't limit to web pages (like the browser based answer) either

Just run xmag. From its man page:

  • The xmag program allows you to magnify portions of an X screen.
  • The area can be dragged out to the desired size by pressing Button 2.
  • Once a region has been selected, a window is popped up showing a blown up version of the region in which each pixel in the source image is represented by a small square of the same color.
  • "Pressing Button1 in the enlargement window shows the position and RGB value of the pixel under the pointer until the button is released" -- this, is the X11 native solution for Color Picker.
1

Another way to get a simple color picker is to install yad (Yet Another Dialog) and run yad --color.

1
  • Simple, for those who need yad for their shell scripts.
    – braoult
    Jan 18 at 20:40
0

I recommend GPick:

sudo apt-get install gpick

Applications -> Graphics -> GPick

It's got a lot more features than gcolor2 but is still extremely simple to use - click on one of the hex swatches, move your mouse around the screen over the colours you want to pick, then press the space bar to add to your swatch list.

It also has a traditional colour picker (like gcolor2) in the bottom right-hand corner of the window to allow you to pick individual colours with magnification.

0

The Gnome Shell extension Color Picker provides a picker and a color palette, generated from previously selected colors.

The picker

enter image description here

The color palette

enter image description here

Source: https://extensions.gnome.org/extension/3396/color-picker/

0

For those who struggle getting eiter gpick or gcolor3 running: it seems neither of those work on Wayland. However, there is an even simpler tool called wl-color-picker that does the job.

wl-color-picker

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .