Brian Dunning's FileMaker Custom Functions

PixelColor ( hex )

Generate a 1x1 px image (encoded in base64) of the specified color

  Be the first to rate this function Log in to vote

Andrea Niro   Andrea Niro - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
1. PixelColor ( "#FFF" )
2. PixelColor ( "#5A4419" )
3. PixelColor ( "F9F9F9" )
  Sample output:
1. R0lGODlhAQABAPAAAA8PD////yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==
2. R0lGODlhAQABAPAAAFpEGf///yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==
3. R0lGODlhAQABAPAAAPn5+f///yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==

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

Accepted inputs are:
#FFFFFF
FFFFFF
#FFF
FFF

--------------------------------------------------------------------------------------

The function can output the image directly (_image) instead of the encoded string, if so desired.
The function also include the data prefix (_uriData) if the full Data URI is needed: just prepend it to the _uri variable

--------------------------------------------------------------------------------------

Dependencies:
PixelColor_EncodeTriplet ( x ; y ; z ) [ https://www.briandunning.com/cf/2468 ]
Base16To10 ( hex ) [ Converts a value from hexadecimal (base16) to decimal (base10) ]

 

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: