How to pick a color for pasting it in HTML code

Ideas for improvements and requests for new features in XnView Classic

Moderators: XnTriq, helmut, xnview

User avatar
Talker
Posts: 3
Joined: Fri Aug 21, 2015 5:05 pm

How to pick a color for pasting it in HTML code

Post by Talker »

Hi!

Is there an easy way to pic a color and copy it to the Clipboard for pasting it in HTML code? Just like the "Copy Color Hex Code" in Photoshop.

In XnView I've found "View / Display Color Information" but I don't know how to copy an HTML color code to the Clipboard.
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How to pic a color for pasting it in HTML code

Post by XnTriq »

User avatar
xnview
Author of XnView
Posts: 44883
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: How to pic a color for pasting it in HTML code

Post by xnview »

so copy the current shown color from 'Display Color Information' in clipboard?
Pierre.
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How to pic a color for pasting it in HTML code

Post by XnTriq »

xnview wrote:so copy the current shown color from 'Display Color Information' in clipboard?
Yes :-)
  1. Option for Hex (#ffffff) vs. RGB (rgb(255,255,255)) format
  2. Preview in tooltip
p131303_1.png
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 44883
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: How to pic a color for pasting it in HTML code

Post by xnview »

XnTriq wrote:
xnview wrote:so copy the current shown color from 'Display Color Information' in clipboard?
Yes :-)
So how to copy it? A left click?
Pierre.
User avatar
XnTriq
Moderator & Librarian
Posts: 6387
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How to pic a color for pasting it in HTML code

Post by XnTriq »

xnview wrote:So how to copy it? A left click?
Left and right mouse buttons (without modifier key) are already used for Make selection or Move picture in XnView (ToolsOptions...Keyboard/MouseMouse).
Disabling Make selection and Move picture when Display Colour Information is active would cause problems with the following INI tweak, I guess:
XnView Wiki (UI-less Settings → [url=http://www.xnview.com/wiki/index.php/UI-less_Settings#View]View[/url] → ColorInfo) wrote:Changes the behavior of the color information tool.
  • 0 Show only for the currently viewed image.
    1 Show also for the previous¦next file to view.
    2 Show between sessions.
Value: Integer, default value is 0
Many image editors allow the user to constrain the selection ratio to 1:1 (square/circle vs. rectangle/ellipse) with Shift+LMB. In Phototshop, Shift+Alt+LMB centers the selection around the point where you first clicked (in addition to constraining the selection to a square or circle). Ctrl+LMB and Alt+LMB are often used for adding or subtracting to a selection.
I'm fully aware that XnView isn't meant to be an editor, but in case Pierre decides to expand the cropping functionality, these modifier keys should still be available, IMO.

So, how about Ctrl+RMB?
User avatar
blablaalb
Posts: 9
Joined: Wed Feb 10, 2021 9:59 am

Re: How to pic a color for pasting it in HTML code

Post by blablaalb »

xnview wrote: Wed Apr 12, 2017 2:16 pm
XnTriq wrote:
xnview wrote:so copy the current shown color from 'Display Color Information' in clipboard?
Yes :-)
So how to copy it? A left click?
I'm sorry for awakening an old thread, but I just wanted to reconfirm that such functionality could come very handy for various people, web designers and developers in particular.
Image this pop-up box isn't very helpful to be honest, as it's not possible to copy the values. As an option, you could consider freezing the pop-up box after cursor is hovering above it, so the user could copy the values. Or could go even further and add a more sophisticated pop-up window with zoomed-in pixels under the cursor, color pallete, color code in rgb and hex format etc. Something similar to this Image.
Just a suggestion from a long time user :mrgreen:
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: How to pic a color for pasting it in HTML code

Post by helmut »

The colour picker (View >> Show colour information) has been introduced a long time a go. From my point of view there is little real use of the way it works as it is because it doesn't support a standard use case.

I guess most people will activate "Show colour information" in order to get to know a specific colour value of the image and then want to exit that mode and use the colour information in some way (e.g. insert it in HTML editor, a document, or similar). ATM, this use case isn't supported well and I wonder how this could be improved.

Perhaps the current, pretty special behaviour of "Show colour information" could become more standard with setting like this:
Show colour information 01.png
These above setting would allow for supporting both existing behaviour and introducing a new, more common behaviour which is starting a temporary colour pick mode and exit this mode as soon as you click with the mouse. By default, the new behaviour should be supported because it supports better the standard use case.

Just my 2cents... ...more ideas and comments are welcome...
You do not have the required permissions to view the files attached to this post.
kukris
Posts: 6
Joined: Tue Oct 10, 2017 6:29 pm

Re: How to pick a color for pasting it in HTML code

Post by kukris »

I recently tried to use the batch command Replace Color and I missed a convenient color picker that would allow me to select a color from an image and save it to the custom color palette. I did it with an external tool but I would prefer to have an integrated solution like expanding the current function Show colour information or adding a new one.

So here is my suggestion to improve the current functionality which currently only displays the color code and does not save it.
It would be already a great improvement just to integrate the save to the color palette to the function Show colour information.
XnView-ReplaceColor-ColorPicker.png
1 Batch processing -> Transformations -> Replace color (or any other place where needed)
2 Add a function call for the color picker (or any other place where needed)
3 Pick a color from an image with left mouse click
4 Open the color palette and automatically put the color code in the marked box
You do not have the required permissions to view the files attached to this post.