Brian Dunning's FileMaker Custom Functions

HSBtoRGB ( hueDegrees ; satPercentage ; briPercentage )

Converts color from HSB/HSV values to RGB percentages.

  Average rating: 4.0 (39 votes) Log in to vote

Joe Rovang   Joe Rovang - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
HSBtoRGB ( 240 ; 1 ; .5 )
  Sample output:
0
0
.5

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

Parameters:
hueDegrees
satPercentage
briPercentage

This function converts the specified color from hue, saturation, and brightness/value (HSB/HSV) to RGB percentages. (Note that HSB/HSV is not the same as HSL!)

Note that while hue is expressed in degrees, all other values are expressed in decimals between 0 and 1, inclusively. To use the output RGB values in a TextColor function, you'd first need to multiply them by 255 and round to whole numbers.

I'm sorry to say that I don't actually understand the math behind the function - I translated it from formulas listed on Wikipedia.

 

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 15 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:

Under construction. Email me your wish list for improvements.