Home

# Library goog.color.alpha

Function Summary
| `extractAlpha(string colorWithAlpha) ⇒ string` Gets the alpha color part of an alpha hex color. For example, from '#abcdef55' return '55'. The result is guaranteed to be two characters long.
| `extractHexColor(string colorWithAlpha) ⇒ string` Gets the hex color part of an alpha hex color. For example, from '#abcdef55' return '#abcdef'.
| `hexToRgba(string hexColor) ⇒ ?Array` Converts an 8-hex representation of a color to RGBA.
| `hexToRgbaStyle(string hexColor) ⇒ string` Converts a hex representation of a color to RGBA.
| `hslaArrayToHex(?Array.<number> hsla) ⇒ string` Converts a color from HSLA to hex representation.
| `hslaArrayToRgbaStyle(?Array.<number> hsla) ⇒ string` Converts a color from HSLA to an RGBA style string.
| `hslaToHex(number h, number s, number l, number a) ⇒ string` Converts a color from HSLA to hex representation.
| `hslaToRgba(number h, number s, number l, number a) ⇒ ?Array.<number>` Converts a color from HSLA color space to RGBA color space.
| `hslaToRgbaStyle(number h, number s, number l, number a) ⇒ string` Converts a color from HSLA to an RGBA style string.
| `hsvaArrayToHex(?Array hsva) ⇒ string` Converts from an HSVA array to a hex string
| `hsvaToHex(number h, number s, number v, number a) ⇒ string` Converts from h,s,v,a values to a hex string
| `isNormalizedAlphaHexColor_(string str) ⇒ boolean` Checks if a string is a normalized alpha hex color. We expect strings of the format #RRGGBBAA (ex: #1b3d5f5b) using only lowercase letters.
| `isValidAlphaHexColor_(string str) ⇒ boolean` Checks if a string is a valid alpha hex color. We expect strings of the format #RRGGBBAA (ex: #1b3d5f5b) or #RGBA (ex: #3CAF == #33CCAAFF).
| `isValidHslaColor_(string str) ⇒ ?Array.<number>` Checks if a string is a valid hsla color. We expect strings of the format 'hsla(h, s, l, a)', where s in an int in [0, 360], s and l are percentages between 0 and 100 such as '50%' or '70%', and a is a float in [0, 1].
| `isValidRgbaColor_(string str) ⇒ ?Array.<number>` Checks if a string is a valid rgba color. We expect strings of the format '(r, g, b, a)', or 'rgba(r, g, b, a)', where r, g, b are ints in [0, 255] and a is a float in [0, 1].
| `normalizeAlphaHex_(string hexColor) ⇒ string` Normalize a hex representation of an alpha color.
| `parse(string str) ⇒ ?Object` Parses an alpha color out of a string.
| `rgbaArrayToHex(?Array.<number> rgba) ⇒ string` Converts a color from RGBA to hex representation.
| `rgbaArrayToHsla(?Array.<number> rgba) ⇒ ?Array.<number>` Converts a color from RGBA color space to HSLA color space.
| `rgbaArrayToRgbaStyle((Array.<number>|Float32Array|null) rgba) ⇒ string` Converts a color from RGBA to an RGBA style string.
| `rgbaStyle_(?Array.<number> rgba) ⇒ string` Takes an array of [r, g, b, a] and converts it into a string appropriate for CSS styles.
| `rgbaToHex(number r, number g, number b, number a) ⇒ string` Converts a color from RGBA to hex representation.
| `rgbaToHsla(number r, number g, number b, number a) ⇒ ?Array.<number>` Converts a color from RGBA color space to HSLA color space. Modified from {@link http://en.wikipedia.org/wiki/HLS_color_space}.
| `rgbaToRgbaStyle(number r, number g, number b, number a) ⇒ string` Converts a color from RGBA to an RGBA style string.