This can be done with a very simple script:
var color = app.foregroundColor;
color.hsb.hue = color.hsb.hue < 180 ? color.hsb.hue + 180 : color.hsb.hue - 180;
app.foregroundColor = color;
save this as a your_name.jsx
file to
- Windows:
C:\Program Files\Adobe\Adobe Photoshop CC 2019\Presets\Scripts
- Mac:
/Applications/Adobe Photoshop CC 2019/Presets/Scripts
folder and after restarting Photoshop the script will be available in File > Scripts > your_name
. Then you can assign it to a shortcut (via menu Edit > Keyboard Shortcuts...
) or use it in an Action (and assign it to an F-key). This way after calling the script your foreground color will be changed to an inverted color (in RGB model).
You can easily modify it so that it'd change background color or, for instance, set a BG color using a FG color... just change app.foregroundColor
with app.backgroundColor
.
And the same way you can change color saturation or brightness (or any of the rgb, cmyk and lab values).