What you can do is use a calculation in your RGB() code.
Normally you fill in a number between 0 and 255, but you can also fill in a calculation. Just make sure that the outcome is between 0 and 255.
=RGB((255-(expression1)) , ((expression2)) , (100 +(expression3)) )
This works correct if you use, for example, expressions which calculate a percentage.
Hope this is helpfull
Here is something I tried:
I made with the dimension Week from my Maste_Calender table, but you can use it on any dimension you want.
First I add the below line to my script:
AutoNumber(Week) as Counter
Max(Counter) as maxcounter
Group by Year;
Floor(Counter / maxcounter *255) as ColourCode
Drop fields Counter, maxcounter from Master_Calendar;
This creates a field named ColourCode with a value from 1 to 255, based on the field Week
So now every week has its own colour code
Now you can use in any charts with Week as your dimension.
=RGB(ColourCode, 0, 0)
=RGB(ColourCode, (ColourCode /2), 200)
Let me know if this what you are looking for, Ok?
There is no reference to the "current cell" value available in an expression. But what you can do is put your color expression in a variable with param and use it as a function in the background expression.
In your script or the Variable editor:
SET vColorCell = if($1 > 100, red(), if($1>60, blue(), if($1> 40, yellow(), green())));
Then in the background expression: