Converts a color-string, e.g. ("rgb(a,b,c)") into a hex-color-string.


Syntax

colorStr2Hex(?string $color): string

  • $color - string
    The color-string to format in hex-notation.
    If the string is already in hex-notation (starting with a "#") this $color is returned.


Example


{{ hublify.colorStr2Hex("rgb( 255, 0, 128)") }}          =>    #ff0080