# Global

##

### Methods

#### darken(color, percent [, render])

  Darken a color

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `color` | String |  |  | rgb or hex string
  `percent` | Number |  |  | Percent (between 0 and 1)
  `render` | String | <optional> | obj | render type: obj, hex or rgba

  ##### Returns:

  Type
    Color_object

#### formatHexColor(color)

  Format an object color to an hex color

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `color` | Color_Object |

  ##### Returns:

  Type
    String

  ##### Example

      formatHexColor( color );

#### formatRGBAColor(color)

  Format an object color to an rgba color

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `color` | Color_Object |

  ##### Returns:

  Type
    String

  ##### Example

      formatRGBAColor( color );

#### hexToRgba(hex)

  Convert a hex string to a rgba string

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `hex` | String |

  ##### Returns:

  Type
    String

  ##### Example

      hexToRgba( '#F5C' );
      hexToRgba( '#F5B3D8' );

#### isHexColor(hexColor)

  Return true if the string is an hexadecimal color

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `hexColor` | String |

  ##### Returns:

  Type
    Boolean

  ##### Example

      isHexColor( '#FFF' );
      isHexColor( '#55CC66' );
      isHexColor( '#55CC66FF' );

#### isRGBA(rgba)

  Return true if the string is an rgb or rgba color

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `rgba` | String |

  ##### Returns:

  Type
    Boolean

  ##### Example

      isRGBA( 'rgb(125 ,233, 105)' );
      isRGBA( 'rgba(125 ,233, 105, 0.25)' );

#### lighten(color, percent [, render])

  Lighten a color

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `color` | String |  |  | rgb or hex string
  `percent` | Number |  |  | Percent (between 0 and 1)
  `render` | String | <optional> | obj | render type: obj, hex or rgba

  ##### Returns:

  Type
    Color_object

#### rgbaToHex(rgba)

  Convert a rgba string to a hex string

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `rgba` | String |

  ##### Returns:

  Type
    String

  ##### Example

      rgbaToHex( 'rgb(125 ,233, 105)' );
      rgbaToHex( 'rgba(125 ,233, 105, 0.25)' );

#### shadeBlend(color1, color2, percent [, render])

  Darken, lighten one color or blend 2 colors together

  ##### Parameters:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `color1` | String |  |  | rgb or hex string
  `color2` | String | null |  |  | rgb or hex string
  `percent` | Number |  |  | Percent (between -1 and 1)
  `render` | String | <optional> | obj | render type: obj, hex or rgba

  ##### Returns:

  Type
    Color_Object | String

  ##### Example

      var color1 = "#FF343B";
      var color2 = "#343BFF";
      var color3 = "rgb(234,47,120)";
      var color4 = "rgb(120,99,248)";

      // Lighten color
      var shadedcolor1 = shadeBlend( color1, null, 0.75 );

      // Darken color
      var shadedcolor3 = shadeBlend( color3, null, -0.5 );

      // Blend 2 colors
      var blendedcolor1 = shadeBlend( color1, color2, 0.333 );
      var blendedcolor34 = shadeBlend( color3, color4, -0.8 );

#### splitHexColor(hexColor)

  Split an hexadecimal color

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `hexColor` | String |

  ##### Returns:

  Type
    Color_Object

  ##### Example

      splitHexColor( '#F5A' );
      splitHexColor( '#FA58AC' );

      // With alpha
      splitHexColor( '#FA58ACCC' );

#### splitRGBA(rgba)

  Split an rgb or rgba color

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `rgba` | String |

  ##### Returns:

  Type
    Color_Object

  ##### Example

      splitRGBA( 'rgb(125 ,233, 105)' );
      splitRGBA( 'rgba(125 ,233, 105, 0.75)' );

### Type Definitions

#### Color_Object

  ##### Type:

  - Object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `r` | Number |
  `g` | Number |
  `b` | Number |
  `a` | Number |
  `hr` | String |
  `hg` | String |
  `hb` | String |
  `ha` | String |

#### Search results