color_test.js
No description.

File Location

/goog/color/color_test.js


Public Protected Private

Global Functions

assertColorFuzzyEquals(Strexpectedactualdelta)
Checks equivalence between two colors' respective values. Accepts +- delta for each pair of values
Arguments:
Str : string
No description.
expected : Array.<number>
No description.
actual : Array.<number>
No description.
delta : number
Margin of error for each element in color array
code »
colorConversionTestHelper(funcOnefuncTwocolorDELTA)
Helper function for color conversion functions between two colorspaces.
Arguments:
funcOne : Function
Function that converts from 1st colorspace to 2nd
funcTwo : Function
Function that converts from 2nd colorspace to 2nd
color : Array.<number>
The color array passed to funcOne
DELTA : number
Margin of error for each element in color
code »
rgbColorsAreEqual(rgb1rgb2) boolean
This helper method compares two RGB colors, checking that each color component is the same.
Arguments:
rgb1 : Array.<number>
Color represented by a 3-element array with red, green, and blue values respectively, in the range [0, 255].
rgb2 : Array.<number>
Color represented by a 3-element array with red, green, and blue values respectively, in the range [0, 255].
Returns: boolean  True if the colors are the same, false otherwise.
code »
testColorBlend()
This method runs unit tests against goog.color.blend(). Test cases include: blending arbitrary colors with factors of 0 and 1, blending the same colors using arbitrary factors, blending different colors of varying factors, and blending colors using factors outside the expected range.
code »
testColorDarken()
This method runs unit tests against goog.color.darken(). Test cases include darkening black with arbitrary factors, edge cases (using 0 and 1), darkening colors using various factors, and darkening colors using factors outside the expected range.
code »
testColorDiff()
This method runs unit tests against goog.color.colorDiff_().
code »
testColorLighten()
This method runs unit tests against goog.color.lighten(). Test cases include lightening white with arbitrary factors, edge cases (using 0 and 1), lightening colors using various factors, and lightening colors using factors outside the expected range.
code »
testHSLBidiToRGB()
No description.
code »
testHSVSpecRangeIsCorrect()
No description.
code »
testHSVToRGB()
No description.
code »
testHexToRgb()
No description.
code »
testHexToRgbStyle()
No description.
code »
testHighContrast()
This method runs unit tests against goog.color.highContrast().
code »
testHslDistance()
This method runs unit tests against goog.color.hslDistance().
code »
testHslToHex()
No description.
code »
testHslToRgb()
No description.
code »
testHsvToHex()
No description.
code »
testIsValidColor()
No description.
code »
testIsValidHexColor()
No description.
code »
testIsValidRgbColor()
No description.
code »
testParse()
No description.
code »
testRgbToHex()
No description.
code »
testRgbToHsl()
No description.
code »
testYiqBrightness()
This method runs unit tests against goog.color.yiqBrightness_().
code »
testYiqBrightnessDiff()
This method runs unit tests against goog.color.yiqBrightnessDiff_().
code »

Global Variables

black :
No description.
Code »
lemonchiffron :
No description.
Code »
name1 :
No description.
Code »
name2 :
No description.
Code »
pair :
No description.
Code »
sienna :
No description.
Code »
white :
No description.
Code »

Directory color

File Reference