This topic is locked

Changing field colour - 'gradient '

7/8/2009 5:44:09 AM
PHPRunner General questions
T
TKindermann author

Hello, I have a question for professionals :-)
I have a numeric field with data from 15.0 till 45.0
I have also create a event 'List page: After record processed"
> 25)

{

$record["bmi_style"]='style="background:red"';

}
But what I want is the following:

the colour should be change from

15.0 -> deep blue over

25.0 -> deep green to

45.0 -> deep red
Is it possible for creating such a gradient depent from the value ?
Kind regards
Thomas

J
Jane 7/8/2009

Thomas,
you can create a couple of images with gradient and set up background as image for each value.

T
TKindermann author 7/9/2009

yes, that's one solution.
Is it not possible to calculate the colour ?
Thomas

A
ashipley 7/9/2009

You could stack a series of IF / else statements to do this
If entered value > highest test value, turn backgound Red

Else if entered value > medium test value, turn background green

else if entered value > lowest test value, turn backgriund blue
If the value fails all of the tests, the background remains the default color