Skip to main content
Inspiring
April 27, 2020
Answered

Can anyone create a script to adjust brightness in RGB and Greyscale mode by +2 and - 2?

  • April 27, 2020
  • 2 replies
  • 3272 views

Hi,

I have no scripting skills but I suspect that writing the above script would be relatively straightforward for those of you who do!  I would like to associate a +2 and -2 script for the brightness value in the foreground color to speed up the painting process, special kudos if this works in both RGB and Greyscale.

This topic has been closed for replies.
Correct answer c.pfaffenbichler

Now it's all clear
here's what you need

value +2

app.foregroundColor.hsb.hue += 2.0;

 

value -2

app.foregroundColor.hsb.hue -= 2.0;


I think the OP wanted to change the brightness, though. 

 

app.foregroundColor.hsb.brightness += 2.0;

2 replies

Geppetto Luis
Legend
April 27, 2020

Jamie
You have solved or are still having problems

JJamieAuthor
Inspiring
April 28, 2020

Perfect, I was looking at brightness and didn't notice hue changing instead, the edit sorted this out, thank you to you both. I now have this set up on F11 and F12.

JJamieAuthor
Inspiring
June 18, 2020

OK, this is an old thread but I'm hoping to revive it with a question. Adjusting value between 1-100 is solved but actually this would be much better if it adjusted between 1 and 254 because the former method inevitably creates clusters of values. Over to you!

Geppetto Luis
Legend
April 27, 2020

I would like to help you but I have not understood what you really need
you can give an example

sorry can't you use the contrast brightness adjustment level?

JJamieAuthor
Inspiring
April 27, 2020

Hi geppettol,

I'm painting a lot of value studies (brightness in the HSB model) and even when I paint with color, it is the brightness that requires constant adjustment. This is direct painting and not image manipulation so adjustments are not helpful, every mark I paint wants a controlled value. I tried capturing an action, I typed +2 in the brightness attribute but this doesn't return a context sensitive +2 number, it just records an absolute number. What I'd like is to use shortcuts linked to scripts so that when I'm painting I can run up and down the brightness scale without losing focus on the painting. This may seem like a small thing but it would be a huge time saver, perfect for a script. I hope that is clearer? Thank you.

c.pfaffenbichler
Community Expert
c.pfaffenbichlerCommunity ExpertCorrect answer
Community Expert
April 27, 2020

Now it's all clear
here's what you need

value +2

app.foregroundColor.hsb.hue += 2.0;

 

value -2

app.foregroundColor.hsb.hue -= 2.0;


I think the OP wanted to change the brightness, though. 

 

app.foregroundColor.hsb.brightness += 2.0;