Interface color

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

d3mac123

Interface color

Post by d3mac123 »

With the new color options for the interface, I am trying to switch the colors of my panel accordingly. Is there a way to capture this info? I tried (without success):
Code: Select allapp.preferences.interface.colorTheme


ideas?
thanks!

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

txuku

Interface color

Post by txuku »

Bonjour d3mac123

With a ScriptingListenerJS.log ?
miked

Interface color

Post by miked »

I noticed this when cruising through the CS6 Fit Image.jsx

Code: Select all       // match our dialog background color to the host application
        d.graphics.backgroundColor = d.graphics.newBrush (d.graphics.BrushType.THEME_COLOR, "appDialogBackground");

It seems to apply to the Window object containing the GUI resource string. It's around line 230. HTH.

...Mike
jacobolus

Interface color

Post by jacobolus »

If you use ActionDescriptor code, you can grab it out. I think this should work (I’m going off an application descriptor I saw earlier though. This computer doesn’t have CS6 on it, so is missing that 'kuiBrightnessLevel' key). Let me know if it works.

The output should be one of: "DarkGray", "MediumGray", "LightGray", "Original".


Code: Select allvar $s = function (stringID) { return app.stringIDToTypeID(stringID); }

var interface_brightness = function() {
    app_ref = new ActionReference;
    app_ref.putIndex($s('application'), 0);
    app_descriptor = app.executeActionGet(app_ref);
    return app.typeIDToStringID(app_descriptor
        .getObjectValue($s('interfacePrefs'))
        .getEnumerationValue($s('kuiBrightnessLevel'))
        ).substr(16);
}

interface_brightness();


If you want to know the specific RGB of the colors of the interface, you can get to that too, via a whole bunch of different keys in the top-level application descriptor.
jacobolus

Interface color

Post by jacobolus »

If anyone has CS6, does that actually work?
undavide

Interface color

Post by undavide »

Late, but confirmed - it works!

Davide