• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

how can i copy hex code when i just open the color piker?

New Here ,
Dec 26, 2022 Dec 26, 2022

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.

TOPICS
Windows

Views

173

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2022 Dec 26, 2022

Copy link to clipboard

Copied

What version of photoshop and windows are you using?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2022 Dec 27, 2022

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.

 

Photoshop color picker default color model.gif

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

@Conrad C – Good point, I was testing in RGB docs and can confirm your results!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

LATEST

omg thank you! Now i understand more about photoshop. Have a lucky day!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2022 Dec 27, 2022

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2022 Dec 27, 2022

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);
}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save as a plain text format file – .txt
  5. Rename the saved file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below)

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines