Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Help with changing lightness of foreColor script

$
0
0

Hello,

I'd like a little help with scripting here: I'm currently using this script I've found in the forums to change the brightness of the current foreground color

 

*****************

#target photoshop

 

    var foreColor = new SolidColor;

 

    foreColorH=app.foregroundColor.hsb.hue; //Initial Value

 

    foreColorS=app.foregroundColor.hsb.saturation;

 

    foreColorB=app.foregroundColor.hsb.brightness;

 

    foreColor.hsb.hue=foreColorH+0;

 

    if (foreColorB+10 > 100) {foreColor.hsb.brightness=100}

 

    else {foreColor.hsb.brightness=foreColorB+10};

 

    foreColor.hsb.saturation=foreColorB+0;

 

    app.foregroundColor = foreColor;

 

*********************

Changing this script for -10 brightness does the result below (red arrows), but what I really need is to change the lightness down so the color picker goes straight down, like the blue goes straight up.

Many thanks for any help.

 

lightness.jpg


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>