1

Can someone tell me how to copy/paste the hex color value showed by palette (M-x palette) into the current buffer. When I hit Enter key it displays another frame

palette From this I'd liked to copy then paste the hex value in current buffer. Hitting Enter brings the below frame..

enter image description here After hiting Enter key

2
  • That appears to be part of an extension rather than part of Emacs itself. Do you know where you got it. You might also try using C-h f to find out more information about how to use it.
    – db48x
    Jun 3, 2022 at 22:01
  • I found that package here. Added to my load path. emacswiki.org/emacs/palette.el Jun 4, 2022 at 7:13

1 Answer 1

1

Unfortunately, I haven't bothered to update palette.el for recent Emacs versions (even for not-so-recent versions).

So what you're showing isn't at all what should be shown. The palette.el code depended on the display behavior of Emacs windows as it was long ago. I'm sure the code could be updated to do what it used to do, which is what is shown here. But I haven't bothered to try; sorry.


As for your question, M-w copies the hex RGB value of the palette's current color to the kill ring. I think that's what you're asking: how to get the hex code for a color. There are various ways of getting one of the colors in the palette to be the current color (so you can use M-w), including clicking with mouse-2 or using RET when the cursor is on it.

You can also click mouse-1 or use ? anywhere to see the info about a color (including its hex RGB code) in the echo area (where the minibuffer is). Clicking in that area opens buffer *Messages*, where you can copy any info from that and other messages.

See the doc in the source file's Commentary; it's pretty extensive.

But again, apologies for the fact that the library isn't very useful anymore - it badly needs to have its window display fixed.


This is what you should see -- it's a far cry from what you do see nowadays.

palette


You didn't ask this, but it might help:

If you just want to get the hex RGB code for the named colors supported in your Emacs session, you can use M-x list-colors-display (a standard Emacs command). That shows you all of the named colors with their hex codes.

(And if you click a hex code there when the palette is open then it changes the palette's current color to the color whose code you clicked.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.