Class GssFunctions.AdjustBrightness

java.lang.Object
com.google.common.css.compiler.gssfunctions.GssFunctions.AdjustBrightness
All Implemented Interfaces:
GssFunction
Enclosing class:
GssFunctions

public static class GssFunctions.AdjustBrightness extends Object implements GssFunction
Implementation of the adjustBrightness GSS function. This generates a slightly differentiated color suitable for hover styling. Takes the color to modify as the first argument, and the requested brightness difference as a second argument (between 0 and 100). This function will always ensure that the returned color is different from the input, e.g. attempting to "brighten" white will return a light grey instead of white, but if it isn't possible to find a color that matches the request difference (e.g. asking to brighten by 100 from a medium bright color), the returned value will be a color with a difference from the input color as close as possible to what is being requested. See the unit test for some examples.