On Sunday, September 2, 2018 at 3:56:57 PM UTC-4, bgrattan wrote: > > It's probably something simple but I've tried everything I can think of > at this point. Could someone help on this? > > My site: *grattans.org/wx <http://grattans.org/wx>* >
tom answered your question, but please consider the following code instead. it keeps the logic separate from the formatting and reduces the amount of code. it also eliminates the corner cases in which values that fall between ranges end up with a color you probably did not expect. #if $day.UV.has_data #if $current.UV.raw >= 10.5 #set $bgcolor='violet' #else if $current.UV.raw >= 7.5 #set $bgcolor='red' #else if $current.UV.raw >= 5.5 #set $bgcolor='orange' #else if $current.UV.raw >= 2.5 #set $bgcolor='yellow' #else #set $bgcolor='limegreen' #end if <tr class = "even"> <td class="stats_label">UV Index</td> <td class="stats_uv_data" style="background-color: $bgcolor">$current.UV</td> #end if -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
