Categories

ep.color.stringToHex()

Categories: Color | Utilities

ep.color.stringToHex( string )

Plugin: ep.color

Description: Convert css color string to hex color.

  • ep.color.stringToHex( string )

    version added: 6.12.0

    string   A css color string.

Convert a css color string to hex color string.

  • Convert css color string to hex color.

    Code:
    ep.color.stringToHex('green');
    
    Results:
    #008000
    
    
  • Convert css color string to hex color.

    Code:
    ep.color.stringToHex('rgb(0,128,0)');
    
    Results:
    #008000
    
    
  • Convert css color string to hex color.

    Code:
    ep.color.stringToHex('rgba(0,128,0,1)');
    
    Results:
    #008000