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!
Interface color
Interface color
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
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
Interface color
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.
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.