Class GssFunctions
java.lang.Object
com.google.common.css.compiler.gssfunctions.GssFunctions
Container for common GSS functions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImplementation of the addHsbToCssColor GSS function.static classThe "add()" function adds a list of numeric values.static classImplementation of the adjustBrightness GSS function.static classBase implementation of the color blending GSS function.static classAbstract base class providing HSL color space manipulation functions.static classImplementation of the blendColorsHsb GSS function.static classImplementation of the blendColorsRgb GSS function.static classImplementation of the concat(…) GssFunction.static classDecrease the lightness of a color.static classDecrease the saturation of the specified color.static classAGssFunctionthat returns the quotient of its arguments.static classConvert the color to a grayscale (desaturation with amount of 100).static classIncrease the lightness of a color.static classThe "makeContrastingColor" function generates a contrasting color with the same hue as the input color.static classImplementation of the makeMutedColor GSS function.static classTakes an input color and sets its alpha component without affecting the RGB components.static classAGssFunctionthat returns the max value from its list of arguments.static classAGssFunctionthat returns the min value from its list of arguments.static classAGssFunctionthat returns the product of its arguments.static classIncrease the saturation of the specified color.static classAllows the equivalent of the ternary operator in GSS, using three@defstatements as inputs.static classIncrease or decrease the hue of a color.static classThe "sub()" function subtracts a list of numeric values. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertArgumentLooksLikeAColor(int argOrdinal, CssValueNode argValue, ErrorManager errorManager) Verify a function argument looks like a color node.static StringHelper method for implementors of GssFunction to allow the creation of a url string in the GSS.static CssFunctionNodecreateUrlNode(String imageUrl, SourceCodeLocation location) Helper method for implementors of GssFunction to allow the creation of a url entry node in a GSS file.static GssFunctionExceptionerror(CssValueNode node, String errorMessage, ErrorManager errorManager) static Map<String,GssFunction> static booleanparseBoolean(String numericPart) Helper method to convert a numeric value of "0" or "1" into a boolean.
-
Field Details
-
TRANSPARENT
- See Also:
-
MUST_BE_NUMERIC
- See Also:
-
-
Constructor Details
-
GssFunctions
public GssFunctions()
-
-
Method Details
-
getFunctionMap
- Returns:
- a map from each GSS function name to the function
-
parseBoolean
Helper method to convert a numeric value of "0" or "1" into a boolean.- Parameters:
numericPart- The string containing the value- Returns:
- The corresponding boolean value
-
createUrlNode
Helper method for implementors of GssFunction to allow the creation of a url entry node in a GSS file.- Parameters:
imageUrl- The url of the image to add.location- The location in the GSS file to place the node.- Returns:
- The node containing the url entry.
-
assertArgumentLooksLikeAColor
public static void assertArgumentLooksLikeAColor(int argOrdinal, CssValueNode argValue, ErrorManager errorManager) throws GssFunctionException Verify a function argument looks like a color node.- Throws:
GssFunctionException
-
error
public static GssFunctionException error(CssValueNode node, String errorMessage, ErrorManager errorManager) -
createUrl
Helper method for implementors of GssFunction to allow the creation of a url string in the GSS.- Parameters:
url- The url of the image to add.- Returns:
- The proper GSS url string.
-