New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hex Color Item Format (#FFFFFF) #1583
Comments
The best way to show colors that I can think of is using a Display command below: [Command]
Command="
copyq:
var color = str(input())
setData(mimeHtml,
'<table><tr>'
+ '<td width=\"14\" bgcolor=\"' + color + '\"></td>'
+ '<td> ' + color + '</td>'
+ '</tr></table>'
)"
Display=true
Icon=\xf53f
Input=text/plain
Match=^#[0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z]
Name=Show Colors (Here is how to add the command to CopyQ.) Another way would be to change the background of the item when a color is copied, but this would require fixing the text color: [Command]
Automatic=true
Command="
copyq:
var color = str(input())
setData(mimeColor, color)"
Icon=\xf53f
Input=text/plain
Match=^#[0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z][0-9a-zA-Z]
Name=Show Colors |
I like that look. I think I've seen that pattern used elsewhere too. I'll give it a try. I had no idea about the command system. Time for me to read the manual. |
I prefer a Regex matching Automatic + background
|
Thanks for this! It correctly shows in the main menu but not in the tray icon. Any idea why? |
Is your feature request related to a problem? Please describe.
There is no problem.
Describe the solution you'd like
I'm copying colors all the time as I work on graphic design projects. The colors are written in hex format (#FFFFFF) and can be in upper case, lower case, or combination. The expression matching is very simple.
I would like CopyQ to identify copied colors and, if the item format is enabled, shade the background of the entry with the color described in the copied text.
The item display would revert to the current behavior of appearance when selected or hovered over.
This would just be a new item format, maybe called RGB (or something more descriptive), in the format list of the Items tab in preferences.
Possible Options:
(the background color identifies the RGB item).
(The text would revert to visible when item is selected or hovered).
Enhancement: It would be nice if the foreground color of the entry had logic so that the text is visible over the background color it describes.
Option for enhancement:
Describe alternatives you've considered
It's definitely a new feature.
Additional context
The text was updated successfully, but these errors were encountered: