Product Logo

CNS Image

Import, edit, and export Images in the FileMaker environment

Functions

CNSImage_GetHexColor

NameCNSImage_GetHexColor
Description

This function takes individual Component values and returns the HexColor equivalent for the specified Color Space.

Return TypeText (HexColor)
FormatCNSImage_GetHexColor ( ColorSpace ; Component1 ; Component2 ; Component3 ; Component4 )
Required Parameters
ColorSpace

The Color Space that defines the remaining Component Parameters. Use “RGB”, “RGBA”, “HSV”, “HSL”, “CMY”, or “CMYK”.

Component1

Depending on the ColorSpace, specify the following Component Value:

  • "RGB"/"RGBA" Color Space - Specify the Red Component. (0-255)
  • "HSV"/"HSL" Color Space - Specify the Hue Component. (0-359)
  • "CMY"/"CMYK" Color Space - Specify the Cyan Component. (0-100)
Component2

Depending on the ColorSpace, specify the following Component Value:

  • "RGB"/"RGBA" Color Space - Specify the Green Component. (0-255)
  • "HSV"/"HSL" Color Space - Specify the Saturation Component. (0-100)
  • "CMY"/"CMYK" Color Space - Specify the Magenta Component. (0-100)
Component3

Depending on the ColorSpace, specify the following Component Value:

  • "RGB"/"RGBA" Color Space - Specify the Blue Component. (0-255)
  • "HSV" Color Space - Specify the Value Component. (0-100)
  • "HSL" Color Space - Specify the Luminance Component. (0-100)
  • "CMY"/"CMYK" Color Space - Specify the Yellow Component. (0-100)
Component4

Depending on the ColorSpace, specify the following Component Value:

  • "RGBA" Color Space - Specify the Alpha Component. (0-255)
  • "CMYK" Color Space - Specify the Black Component. (0-100)
Examples
Example 1

Returns "8000FF"

CNSImage_GetHexColor( "RGB" ; 128 ; 0 ; 255 )
Example 2

Returns "77BF30"

CNSImage_GetHexColor( "HSV" ; 90 ; 75 ; 75 )