Page 1 of 1

How to pick a color for pasting it in HTML code

Posted: Wed Apr 06, 2016 9:38 am
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.

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

Posted: Wed Apr 06, 2016 2:45 pm
by XnTriq

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

Posted: Thu Apr 07, 2016 11:43 am
by xnview
so copy the current shown color from 'Display Color Information' in clipboard?

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

Posted: Fri Apr 08, 2016 4:00 am
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
Corel Photo-Paint
Corel Photo-Paint
p131303_1.png (377 Bytes) Viewed 17225 times

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

Posted: Wed Apr 12, 2017 2:16 pm
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?

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

Posted: Thu Apr 13, 2017 3:45 pm
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?

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

Posted: Sat Feb 12, 2022 4:06 pm
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:

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

Posted: Mon Feb 21, 2022 10:29 pm
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
Show colour information 01.png (7.81 KiB) Viewed 13994 times
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...

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

Posted: Mon Apr 29, 2024 7:48 pm
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