Hello @FullSpectrum255 ,
At this time, there doesn't seem to be a way to detect the color of a cell, only to color or clear the color of a cell.
An alternative might be to create a formula that colors the Mean(Yield) cells based upon the value of the Mean(Meets Yield Target) values. Interestingly, when I tried this approach either the numbers were fully erased, or only row 1 would be colored. I wonder if anyone else has tips to make the formula route work, because it's a better solution.
A slightly different approach that is a bit more work, long term, is just to script an if statement to color each cell according to the Mean(Meets Yield Target) values. Examples below.
Names default to here(1);
dt = current data table();
// Works, but you'll need to run the script every time you want the cells colored
for( i = 1, i <= N rows(dt), i++,
if(
:"Mean(Meets Yield Target)"n[i] == 1, :"Mean(Yield)"n << Color Cells( "Green", i ),
:"Mean(Meets Yield Target)"n[i] == 0, :"Mean(Yield)"n << Color Cells( "Yellow", i ),
:"Mean(Meets Yield Target)"n[i] == -1, :"Mean(Yield)"n << Color Cells( "Red", i ),
)
);
/* Better solution, if if was fixed
dt:"Mean(Yield)"n << Set formula(
if(
:"Mean(Meets Yield Target)"n == 1, :"Mean(Yield)"n << Color Cells( "Green", row() ),
:"Mean(Meets Yield Target)"n == 0, :"Mean(Yield)"n << Color Cells( "Yellow", row() ),
:"Mean(Meets Yield Target)"n == -1, :"Mean(Yield)"n << Color Cells( "Red", row() ),
)
);
*/
Learning every day!