Copy link to clipboard
Copied
in photoshop, when i try to copy some hex code, and show up the colour piker, my text box is in betwen the 'c'. so i shoud move my mouse to copy hex code. before, my text box was in hex code so that i can copy easy but now it take so much time. i try reset my photoshop setting but nothing shange.
Copy link to clipboard
Copied
What version of photoshop and windows are you using?
Copy link to clipboard
Copied
What color mode is the document using? When I try it, the default field depends on the document’s color mode. When the document mode is set to Lab Color, the default field is L. For CMYK Color, the default field is C. When set to RGB Color, the default field is hexadecimal. I never noticed this before.
Copy link to clipboard
Copied
@Conrad_C – Good point, I was testing in RGB docs and can confirm your results!
Copy link to clipboard
Copied
omg thank you! Now i understand more about photoshop. Have a lucky day!
Copy link to clipboard
Copied
@asdadw – For me, the hex field is always highlighted when entering the colour picker, no matter whether one of the HSB, RGB, Lab or CMYK fields was previously used. I'm on a Mac and have tested in multiple versions and the behaviour is the same.
A script could be written to copy the foreground colour picker value to the clipboard as hex values, without opening the colour picker window. This could be accessed via a keyboard shortcut.
You could paste your Help > System Info into a reply, that might help pinpoint the issue.
Copy link to clipboard
Copied
@asdadw – whether or not you wanted/needed a script to copy as hex to the clipboard, this was an exercise for me more than anything.
The following two scripts will copy the foreground colour as a hex value to the clipboard. I have commented the code to add/remove various formatting options.
This script uses UPPERCASE without the # prefix:
/* Based on - https://forums.adobe.com/thread/2632707 */
#target photoshop
var RGB2HEX = foregroundColor.rgb.hexValue;
//var RGB2HEX = "#" + foregroundColor.rgb.hexValue;
//var RGB2HEX = foregroundColor.rgb.hexValue.toLowerCase();
//var RGB2HEX = "#" + foregroundColor.rgb.hexValue.toLowerCase();
var d = new ActionDescriptor();
d.putString(stringIDToTypeID("textData"), RGB2HEX);
executeAction(stringIDToTypeID("textToClipboard"), d, DialogModes.NO);
While this script copies to the clipboard in lowercase with the # prefix:
/* Based on - https://gist.github.com/Arahnoid/9923989 */
var fR = Math.floor(app.foregroundColor.rgb.red);
var fG = Math.floor(app.foregroundColor.rgb.green);
var fB = Math.floor(app.foregroundColor.rgb.blue);
rgbToHex(fR, fG, fB);
function rgbToHex(r, g, b) {
var theHex = "#" + ((1 << 24) + (r << 16) + (g << + b).toString(16).slice(1);
//var theHex = ((1 << 24) + (r << 16) + (g << + b).toString(16).slice(1);
// theHex = theHex.toUpperCase();
var d = new ActionDescriptor();
d.putString(stringIDToTypeID("textData"), theHex);
executeAction(stringIDToTypeID("textToClipboard"), d, DialogModes.NO);
}
https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop