Brian Dunning's FileMaker Custom Functions

FadeGreentoRed ( text ; score ; lowest ; highest )

Adjusts the color of 'text' between greeen->yellow->orange-red based upon the 'score' value.

  Average rating: 4.5 (26 votes) Log in to vote

Ryan Brandys   Ryan Brandys
Branmuffin Industries
http://www.branmuffinindustries.com

Share on Facebook Share on Twitter

  Sample input:
FadeGreentoRed ( "seven" ; 7 ; 1 ; 10 )
FadeGreentoRed ( "three" ; 3 ; 1 ; 10 )
FadeGreentoRed ( 2 ; 2 ; 1 ; 3 )
FadeGreentoRed ( "pass" ; 78 ; 1; 100 )
  Sample output:
seven
three
2
pass

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

computes the difference between 'lowest' and highest' and looks to see where 'score' falls in that range. the closer the value is to the 'lowest' value, the more red the word appears. the closer the value is to 'highest' the more green it appears.

this is useful when you want to display a bunch of scores in list view, because you can see what scores are red (bad) or green (good) on a more subconscious level, without having to think about the numbers or their values.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.