Class SassColor
- java.lang.Object
-
- de.larsgrefer.sass.embedded.functions.SassColor
-
public final class SassColor extends Object
Java implementation of thesass:colorModule- See Also:
ColorUtil, sass:color
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.sass_lang.embedded_protocol.Value.ColoradjustHue(com.sass_lang.embedded_protocol.Value.Color color, double hue)Increases or decreases color‘s hue.static doublealpha(com.sass_lang.embedded_protocol.Value.ColorOrBuilder color)Returns the alpha channel of $color as a number between 0 and 1.static doubleblackness(com.sass_lang.embedded_protocol.Value.Color color)Returns the HWB blackness of $color as a number between 0% and 100%.static intblue(com.sass_lang.embedded_protocol.Value.Color color)Returns the blue channel of $color as a number between 0 and 255.static com.sass_lang.embedded_protocol.Value.Colorcomplement(com.sass_lang.embedded_protocol.Value.Color color)Returns the RGB complement of $color.static com.sass_lang.embedded_protocol.Value.Colordarken(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color darker.static com.sass_lang.embedded_protocol.Value.Colordesaturate(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color less saturated.static com.sass_lang.embedded_protocol.Value.Colorgrayscale(com.sass_lang.embedded_protocol.Value.Color color)Returns a gray color with the same lightness as $color.static intgreen(com.sass_lang.embedded_protocol.Value.Color color)Returns the green channel of $color as a number between 0 and 255.static doublehue(com.sass_lang.embedded_protocol.Value.Color color)Returns the hue of $color as a number between 0deg and 360deg.static com.sass_lang.embedded_protocol.Value.Colorhwb(double hue, double whiteness, double blackness)Returns a color with the given hue, whiteness, and blackness and the given alpha channel.static com.sass_lang.embedded_protocol.Value.Colorhwb(double hue, double whiteness, double blackness, double alpha)Returns a color with the given hue, whiteness, and blackness and the given alpha channel.static com.sass_lang.embedded_protocol.Value.StringieHexStr(com.sass_lang.embedded_protocol.Value.Color color)Returns an unquoted string that represents $color in the #AARRGGBB format expected by Internet Explorer’s -ms-filter property.static com.sass_lang.embedded_protocol.Value.Colorinvert(com.sass_lang.embedded_protocol.Value.Color color)Returns the inverse or negative of $color.static com.sass_lang.embedded_protocol.Value.Colorinvert(com.sass_lang.embedded_protocol.Value.Color color, double weight)Returns the inverse or negative of $color.static com.sass_lang.embedded_protocol.Value.Colorlighten(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color lighter.static doublelightness(com.sass_lang.embedded_protocol.Value.Color color)Returns the HSL lightness of $color as a number between 0% and 100%.static com.sass_lang.embedded_protocol.Value.Colormix(com.sass_lang.embedded_protocol.Value.Color color1, com.sass_lang.embedded_protocol.Value.Color color2)Returns a color that’s a mixture of $color1 and $color2.static com.sass_lang.embedded_protocol.Value.Colormix(com.sass_lang.embedded_protocol.Value.Color color1, com.sass_lang.embedded_protocol.Value.Color color2, double weight)Returns a color that’s a mixture of $color1 and $color2.static com.sass_lang.embedded_protocol.Value.Coloropacify(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color more opaque.static intred(com.sass_lang.embedded_protocol.Value.Color color)Returns the red channel of $color as a number between 0 and 255.static com.sass_lang.embedded_protocol.Value.Colorsaturate(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color more saturated.static doublesaturation(com.sass_lang.embedded_protocol.Value.Color color)Returns the HSL saturation of $color as a number between 0% and 100%.static com.sass_lang.embedded_protocol.Value.Colortransparentize(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color more transparent.static doublewhiteness(com.sass_lang.embedded_protocol.Value.Color color)Returns the HWB whiteness of $color as a number between 0% and 100%.
-
-
-
Method Detail
-
adjustHue
public static com.sass_lang.embedded_protocol.Value.Color adjustHue(com.sass_lang.embedded_protocol.Value.Color color, double hue)Increases or decreases color‘s hue.The hue must be a number between -360deg and 360deg (inclusive) to add to $color’s hue.
- See Also:
- adjust-hue
-
alpha
public static double alpha(com.sass_lang.embedded_protocol.Value.ColorOrBuilder color)
Returns the alpha channel of $color as a number between 0 and 1.- See Also:
- alpha
-
blackness
public static double blackness(com.sass_lang.embedded_protocol.Value.Color color)
Returns the HWB blackness of $color as a number between 0% and 100%.- See Also:
- blackness
-
blue
public static int blue(com.sass_lang.embedded_protocol.Value.Color color)
Returns the blue channel of $color as a number between 0 and 255.- See Also:
- blue
-
complement
public static com.sass_lang.embedded_protocol.Value.Color complement(com.sass_lang.embedded_protocol.Value.Color color)
Returns the RGB complement of $color.This is identical to color.adjust($color, $hue: 180deg).
- See Also:
- complement
-
darken
public static com.sass_lang.embedded_protocol.Value.Color darken(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color darker.The $amount must be a number between 0% and 100% (inclusive). Decreases the HSL lightness of $color by that amount.
- See Also:
- darken
-
desaturate
public static com.sass_lang.embedded_protocol.Value.Color desaturate(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color less saturated.The $amount must be a number between 0% and 100% (inclusive). Decreases the HSL saturation of $color by that amount.
- See Also:
- desaturate
-
grayscale
public static com.sass_lang.embedded_protocol.Value.Color grayscale(com.sass_lang.embedded_protocol.Value.Color color)
Returns a gray color with the same lightness as $color.This is identical to color.change($color, $saturation: 0%).
- See Also:
- grayscale
-
green
public static int green(com.sass_lang.embedded_protocol.Value.Color color)
Returns the green channel of $color as a number between 0 and 255.- See Also:
- green
-
hue
public static double hue(com.sass_lang.embedded_protocol.Value.Color color)
Returns the hue of $color as a number between 0deg and 360deg.- See Also:
- hue
-
hwb
public static com.sass_lang.embedded_protocol.Value.Color hwb(double hue, double whiteness, double blackness)Returns a color with the given hue, whiteness, and blackness and the given alpha channel.- See Also:
- hwb
-
hwb
public static com.sass_lang.embedded_protocol.Value.Color hwb(double hue, double whiteness, double blackness, double alpha)Returns a color with the given hue, whiteness, and blackness and the given alpha channel.- See Also:
- hwb
-
ieHexStr
public static com.sass_lang.embedded_protocol.Value.String ieHexStr(com.sass_lang.embedded_protocol.Value.Color color)
Returns an unquoted string that represents $color in the #AARRGGBB format expected by Internet Explorer’s -ms-filter property.- See Also:
- ie-hex-str
-
invert
public static com.sass_lang.embedded_protocol.Value.Color invert(com.sass_lang.embedded_protocol.Value.Color color)
Returns the inverse or negative of $color.- See Also:
- invert
-
invert
public static com.sass_lang.embedded_protocol.Value.Color invert(com.sass_lang.embedded_protocol.Value.Color color, double weight)Returns the inverse or negative of $color.The $weight must be a number between 0% and 100% (inclusive). A higher weight means the result will be closer to the negative, and a lower weight means it will be closer to $color. Weight 50% will always produce #808080.
- See Also:
- invert
-
lighten
public static com.sass_lang.embedded_protocol.Value.Color lighten(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color lighter.The $amount must be a number between 0% and 100% (inclusive). Increases the HSL lightness of $color by that amount.
- See Also:
- lighten
-
lightness
public static double lightness(com.sass_lang.embedded_protocol.Value.Color color)
Returns the HSL lightness of $color as a number between 0% and 100%.- See Also:
- lightness
-
mix
public static com.sass_lang.embedded_protocol.Value.Color mix(com.sass_lang.embedded_protocol.Value.Color color1, com.sass_lang.embedded_protocol.Value.Color color2)Returns a color that’s a mixture of $color1 and $color2.- See Also:
- mix
-
mix
public static com.sass_lang.embedded_protocol.Value.Color mix(com.sass_lang.embedded_protocol.Value.Color color1, com.sass_lang.embedded_protocol.Value.Color color2, double weight)Returns a color that’s a mixture of $color1 and $color2.Both the $weight and the relative opacity of each color determines how much of each color is in the result. The $weight must be a number between 0% and 100% (inclusive). A larger weight indicates that more of $color1 should be used, and a smaller weight indicates that more of $color2 should be used.
- See Also:
- mix
-
opacify
public static com.sass_lang.embedded_protocol.Value.Color opacify(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color more opaque.The $amount must be a number between 0 and 1 (inclusive). Increases the alpha channel of $color by that amount.
- See Also:
- opacify
-
red
public static int red(com.sass_lang.embedded_protocol.Value.Color color)
Returns the red channel of $color as a number between 0 and 255.- See Also:
- red
-
saturate
public static com.sass_lang.embedded_protocol.Value.Color saturate(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color more saturated.The $amount must be a number between 0% and 100% (inclusive). Increases the HSL saturation of $color by that amount.
- See Also:
- saturate
-
saturation
public static double saturation(com.sass_lang.embedded_protocol.Value.Color color)
Returns the HSL saturation of $color as a number between 0% and 100%.- See Also:
- saturation
-
transparentize
public static com.sass_lang.embedded_protocol.Value.Color transparentize(com.sass_lang.embedded_protocol.Value.Color color, double amount)Makes $color more transparent.The $amount must be a number between 0 and 1 (inclusive). Decreases the alpha channel of $color by that amount.
- See Also:
- transparentize
-
whiteness
public static double whiteness(com.sass_lang.embedded_protocol.Value.Color color)
Returns the HWB whiteness of $color as a number between 0% and 100%.- See Also:
- whiteness
-
-