forked from Ancurio/colorpicker
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This feature adds a preview rectangle which shows the current hovered color at the left bottom corner in a 50x50 pixel area.
- Loading branch information
Showing
4 changed files
with
278 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
colorpicker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
.PHONY: clean | ||
|
||
colorpicker : main.c | ||
cc -o colorpicker main.c `pkg-config --libs --cflags gtk+-2.0 gdk-2.0 x11` | ||
CFLAGS := $(shell pkg-config --libs --cflags \ | ||
gtk+-2.0 gdk-2.0 x11 xcomposite xfixes) | ||
|
||
.PHONY : clean | ||
clean : | ||
colorpicker: main.c | ||
cc -o colorpicker main.c $(CFLAGS) | ||
|
||
clean: | ||
rm -f colorpicker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,52 @@ | ||
# colorpicker | ||
|
||
A small tool for X11 that writes the color value on your screen at the cursor position to stdout, in RGB. | ||
A small tool for X11 that writes the color value on your screen at the cursor | ||
position to stdout, in RGB. | ||
|
||
### Usage | ||
|
||
Left click to print the pixel color, any other mouse click to quit the program. | ||
|
||
#### One Shot | ||
|
||
In order to just select one pixel run colorpicker with the `--one-shot` option. | ||
The program will then quit after the first click. | ||
|
||
#### Output Format | ||
|
||
By default the program prints out the color in RGA format and in hexadecimal. | ||
Here is an example: | ||
``` | ||
R: 44, G: 190, B: 78 | Hex: #2CBE4E | ||
``` | ||
|
||
With the help of the `--short` option you can force colorpicker to just | ||
print out the hexadecimal value. Then you just get: `#2CBE4E`. | ||
|
||
#### Color Preview | ||
|
||
colorpicker allows you to show a preview of the color the currently hovered | ||
pixel in a reactangle. This reactangle is located at the bottom left of your | ||
screen. This comes in handy in combination with the one shot option so you | ||
don't pick blindly a color. Just add the `--preview` option for this feature. | ||
|
||
#### Examples | ||
|
||
```bash | ||
# Pick a color and put the hexadecimal value in your clipboard | ||
$ colorpicker --short --one-shot | xsel -b | ||
|
||
# Pick a color with preview and put the hexadecimal value in your clipboard | ||
$ colorpicker --short --one-shot --preview | xsel -b | ||
``` | ||
|
||
### Dependencies | ||
GTK/GDK 2.0. | ||
|
||
* GTK/GDK 2.0 | ||
* X11 | ||
* Xcomposite | ||
* Xfixes | ||
|
||
### License | ||
|
||
MIT |
Oops, something went wrong.