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 - Show more from this author
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.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: