is it possible that the field [Typ..open_close] is not equal to 'open'? if so then the result is null. suggest you just try the colormix1 without the if (obviously, it will be static) but just so you can check if the function works for you or not then work your way back to the if statement. second suggestion, add an else option to your if statement.