Brian Dunning's FileMaker Custom Functions

CF.RGBtoHex ( DRGB )

Converts RGB color string into a Hex color string

  Average rating: 4.6 (24 votes) Log in to vote

Thomas Hellwig   Thomas Hellwig
DELASOCIAL GmbH
http://www.delasocial.com/

Share on Facebook Share on Twitter

  Sample input:
CF.RGBtoHex ( "255083064" )
  Sample output:
#FF5340

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

This function converts a decimal RGB color string like "255083064" into a hexadecimal color string like "#FF5340".

 

Comments

unix   unix, Japan
Mar 2, 2014
In your result, some value should be 0 become 1 ?

Let ( s = GetAsCSS ( TextColor ( ΒΆ ; Left ( DRGB ; 3 ) *256*256 + Middle ( DRGB ; 4 ; 3 ) * 256 + Right ( DRGB ; 3 ) ) ) ;
Middle ( s ; Position ( s ; "#" ; 1 ; 1 ) ; 7 )
)
 
T. Hellwig   T. Hellwig, Hamburg (GER)
Mar 8, 2014
thank you! i am working to solve the problem. and thanks for your alternative example!
 

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.