Categories

ep.color.stringToHsb()

Categories: Color | Utilities

ep.color.stringToHsb( string )

Plugin: ep.color

Description: Convert css color string to hsb color.

  • ep.color.stringToHsb( 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 hsb color.

    Code:
    ep.color.stringToHsb('green');
    
    Results:
    {
        h:120,
        s:100,
        b:50
    }
    
    
  • Convert css color string to hsb color.

    Code:
    ep.color.stringToHsb('rgb(0,128,0)');
    
    Results:
    {
        h:120,
        s:100,
        b:50
    }
    
    
  • Convert css color string to hsb color.

    Code:
    ep.color.stringToHsb('rgba(0,128,0,0.5)');
    
    Results:
    {
        h:120,
        s:100,
        b:50
    }