Class GssFunctions.MakeMutedColor
- java.lang.Object
-
- com.google.common.css.compiler.gssfunctions.GssFunctions.MakeMutedColor
-
- All Implemented Interfaces:
GssFunction
- Enclosing class:
- GssFunctions
public static class GssFunctions.MakeMutedColor extends java.lang.Object implements GssFunction
Implementation of the makeMutedColor GSS function. This is intended to generate a muted flavor of a text or link color. Takes three arguments: the background color over which this text or link will appear, and the text or link color this should be a muted version of and optionally the loss of saturation for muted tone (0 <= loss <= 1).
-
-
Constructor Summary
Constructors Constructor Description MakeMutedColor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CssValueNode>getCallResultNodes(java.util.List<CssValueNode> args, ErrorManager errorManager)Returns the muted color corresponding to the arguments documented inGssFunctions.MakeMutedColor.java.lang.StringgetCallResultString(java.util.List<java.lang.String> args)Processes a list of strings as function arguments and returns a string result.java.lang.IntegergetNumExpectedArguments()Returns the number of expected arguments of this GSS function.protected java.lang.StringmakeMutedColor(java.lang.String backgroundColorStr, java.lang.String foregroundColorStr)protected java.lang.StringmakeMutedColor(java.lang.String backgroundColorStr, java.lang.String foregroundColorStr, java.lang.String lossStr)
-
-
-
Method Detail
-
getNumExpectedArguments
public java.lang.Integer getNumExpectedArguments()
Returns the number of expected arguments of this GSS function.- Specified by:
getNumExpectedArgumentsin interfaceGssFunction- Returns:
- Number of expected arguments
-
getCallResultNodes
public java.util.List<CssValueNode> getCallResultNodes(java.util.List<CssValueNode> args, ErrorManager errorManager) throws GssFunctionException
Returns the muted color corresponding to the arguments documented inGssFunctions.MakeMutedColor.- Specified by:
getCallResultNodesin interfaceGssFunction- Parameters:
args- The list of arguments.- Returns:
- The generated muted color.
- Throws:
GssFunctionException
-
makeMutedColor
protected java.lang.String makeMutedColor(java.lang.String backgroundColorStr, java.lang.String foregroundColorStr, java.lang.String lossStr)
-
makeMutedColor
protected java.lang.String makeMutedColor(java.lang.String backgroundColorStr, java.lang.String foregroundColorStr)
-
getCallResultString
public java.lang.String getCallResultString(java.util.List<java.lang.String> args) throws GssFunctionExceptionDescription copied from interface:GssFunctionProcesses a list of strings as function arguments and returns a string result. Errors are reported by throwingGssFunctionException.- Specified by:
getCallResultStringin interfaceGssFunction- Throws:
GssFunctionException
-
-