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
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.
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.)