Giter Site home page Giter Site logo

farge's People

Contributors

eepykate avatar enva2712 avatar imgbotapp avatar jtbx avatar noah2610 avatar sdushantha avatar seirdy avatar siphonay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

farge's Issues

color picker with zoom?

It can be a bit tricky to pinpoint a color that I want. gpick gives the user a little zoomed in window next to the pointer to make it obvious what you're selecting. Would it be possible to have such a feature in farge? Possibly even use gpick as an alternative backend?

Add `xcolor` to dependencies

Hi

I just installed the package from the AUR and when I ran it I received an error informing me that I need to install the dependency xcolor. This is not mentioned in the readme I thought you might want to add it.

macOS Support Proof of Concept

If you're interested I could create a PR for macOS support or you could add if you have access to a mac. I figured it may be better to include this into a single tool.

macOS Reqs:
hammerspoon w/ cli interface installed. Though it might be possible to remove this with a little work.

Proof of Concept:

# NOTE:  Heavily inspired by https://apple.stackexchange.com/questions/87801/how-to-get-color-of-pixel-in-coordinates-123-456-in-screen/280851#280851

get_pixel_color () {

  # Use hammer spoon to get mouse x,y coords
  X=$(hs -A -c "hs.mouse.absolutePosition()['x']") 
  Y=$(hs -A -c "hs.mouse.absolutePosition()['y']")

  # Screenshot pixel at mouse coords save to $TMPDIR
  # HEX Dump and grab color 
  # NOTE: This will require security and privacy permissions to capture the screen 
    # Testing against known hex colors does not reproduce the same hex, but
    # it does produce the color on the screen. Maybe a difference in color profiles
    # or colorspace. Maybe someone that knows maybe how to convert srbg to whatever can 
    # resolve this issue.
  COLOR=$(
    screencapture -R $X,$Y,1,1 -t bmp $TMPDIR/pixel_color.bmp
    xxd -p -l 3 -s 54 $TMPDIR/pixel_color.bmp |
    sed 's/\(..\)\(..\)\(..\)/\3\2\1/'
  )
  
  # Copy Color to Clipboard
  echo "#$COLOR" | pbcopy

  # Use applescript to display a native OS notification 
  # TODO: This could be improved with imagemagick and hammerspoon 
  osascript -e '
    on run argv
      display notification "#" & item 1 of argv
    end run
  ' $COLOR
}

Enable support for Wayland

I would request you to make this tool also work for Wayland .
Grim is imagepicker can also be used as alternative for Colorpicker .
The command
grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:-
picks color in wayland.
It would be glad to see Wayland support as Wayland is future.

bc as dependency

Installed farge though AUR on i3wm.

This is the default output without bc (same result with any arg):

➜  ~ farge                   
/usr/bin/farge: line 104: bc: command not found
/usr/bin/farge: line 104: [: : integer expression expected

With bc the error is not present anymore. Without bc the command is working as expected though so I am not sure what exactly how it is being used.

Gdk-CRITICAL errors

I'm running KDE on Arch 5.2.1, and I'm getting

(colorpicker:24892): Gdk-CRITICAL **: 06:45:25.595: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed

(colorpicker:24892): Gdk-CRITICAL **: 06:45:25.595: IA__gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(colorpicker:24892): Gdk-CRITICAL **: 06:45:25.595: IA__gdk_pointer_grab: assertion 'window != NULL' failed

no matter what.

Some errors in colorpicker?

Colorpicker works fine on my pc, but farge doesn't seem to do anything. When I try to run farge, it outputs

(colorpicker:150836): Gdk-CRITICAL **: 11:19:12.888: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed

(colorpicker:150836): Gdk-CRITICAL **: 11:19:12.888: IA__gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed

(colorpicker:150836): Gdk-CRITICAL **: 11:19:12.888: IA__gdk_pointer_grab: assertion 'window != NULL' failed

to the console, and doesn't exit afterwards. I think gdk has something to do with gnome, which isn't installed on my system but I don't see why farge would depend on gnome. I run x11 with compton and i3 on arch if it helps.

Can I change the font for rendering? helvetica

Can I change the font that is used for rendering in the default farge command. I get the following error:

/usr/bin/farge: line 104: bc: command not found
/usr/bin/farge: line 104: [: : integer expression expected
convert: unable to read font `helvetica' @ error/annotate.c/RenderFreetype/1425.

I don't think I have the helvetica font installed and would like to change it.

Thank you!

Could you please make a release for this project?

Hi there,

I am wanting to build and maintain this package for Solus Linux. It would greatly benefit me (and possibly others, if the build system works similarly) if you could make a release with a .tar, since the builder scripts need that. I'd really appreciate it!

[Usability] Show 'press q to exit image window' on the first use

Following the "usability of farge" discussion on Reddit, I suggest that, the first time you call farge, it outputs something like To close the color window, click on it and press 'q' on the command-line. Since the tool is command-line, this should be a good way to make it more intuitively-usable while still keeping it nice-looking! As for the internals - you could probably just put a flag file in one of the XDG-approved directories (i.e. .config), check for it and no longer show the message once it's been shown once.

Not getting the tile with color and hex code. Just copying hex code to clipboard.

Hey there! Love this. First off when installing on Arch Linux I had to grab the dependencies via trial and error:

First got this error about

[saint-llama@hubs ~]$ git clone https://github.com/sdushantha/farge
Cloning into 'farge'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 27 (delta 9), reused 10 (delta 2), pack-reused 0
Unpacking objects: 100% (27/27), done.
[saint-llama@hubs ~]$ cd farge
[saint-llama@hubs farge]$ sudo make install
[sudo] password for saint-llama: 
farge has been installed
[saint-llama@hubs farge]$ farge
/usr/bin/farge: line 45: colorpicker: command not found
No color was selected

So I installed colorpicker via:

[saint-llama@hubs farge]$ cd ..                      
[saint-llama@hubs ~]$ git clone https://github.com/ym1234/colorpicker.git
Cloning into 'colorpicker'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 46 (delta 6), reused 15 (delta 3), pack-reused 26
Unpacking objects: 100% (46/46), done.
[saint-llama@hubs ~]$ cd colorpicker
[saint-llama@hubs colorpicker]$ sudo make install
cc -o colorpicker main.c `pkg-config --libs --cflags x11`
mkdir -p /usr/bin/
cp -f colorpicker /usr/bin/
[saint-llama@hubs colorpicker]$ farge
/usr/bin/farge: line 73: xclip: command not found

So I installed xclip via:

[saint-llama@hubs colorpicker]$ sudo pacman -S xclip
resolving dependencies...
looking for conflicting packages...

Packages (1) xclip-0.13-2

Total Download Size:   0.01 MiB
Total Installed Size:  0.06 MiB

:: Proceed with installation? [Y/n] y
:: Retrieving packages...
 xclip-0.13-2-x86_64       14.8 KiB   872K/s 00:00 [######################] 100%
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) installing xclip                             [######################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Now the program runs without error and copies the color hex to clipboard. The only thing is it's not making those tiles with the color preview and hex value. Tried farge and sudo farge just for good measure. Not getting any error either so I'm not sure what's up?

No colorcode text on preview

Installed through AUR in i3wm. Installed dependencies (using feh) in readme for X11. I am only seeing the color in the preview. I notice in the AUR package colorpicker-ym1234-git is mentioned as an optional dependency. I was not sure if this is needed to output the color in feh. I tried also with this particular colorpicker package with the same result. I'm not sure whether this is an issue or I just overlooked something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.