PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Ok so heres the deal, I have a start and end date. I need to set the background color of a row based on how close the current date is to the end date. I was thinking something like:
but then what? I have 10 color shades from 'you have time dont sweat it' to 'there is a fire in your pants' kinda deal. How do I decide what color to choose?
if timediff is > 0 then
switch (timediff):
case > 2 weeks:
colour=green;
break;
case > 1 week:
colour=orange;
break;
case > 3 days:
colour=red;
break;
end
else
colour=red;
end if
I'd agree with Jay. Colours are something that are very difficult to calculate and get good looking results every time. If there's only ten options I'd pick ten and use a switch case block.