Sass change-color() Function
You are Here:
Sass change-color() Function
The change-color()
function sets one or more properties of a color to new values.
Example
SASS TO CSS CONVERTER
.foo {
color: change-color(#6b717f, $red: 100);
color: change-color(#d2e1dd, $red: 100, $blue: 50);
color: change-color(#998099, $lightness: 30%, $alpha: 0.5);
}
Syntax
change-color($color, $red, $green, $blue, $hue, $saturation, $lightness, $alpha)
Parameter Value
Value | Type | Explanation |
---|---|---|
$color | Required | Specifies a color. |
$red | Optional | Specifies red color in RGB value. The arguments must be unitless and between 0 and 255 (both are inclusive). |
$green | Optional | Specifies green color in RGB value. The arguments must be unitless and between 0 and 255 (both are inclusive). |
$blue | Optional | Specifies blue color in RGB value. The arguments must be unitless and between 0 and 255 (both are inclusive). |
$hue | Optional | Specifies the degree to which a stimulus can be described as similar to or different from stimuli that are described as red, green, blue, and yellow. The argument must have either the unit deg or no unit. |
$saturation | Optional | Specifies the intensity of color. The arguments must be between 0 and 100% (both are inclusive). |
$lightness | Optional | Specifies the tone of the color. The arguments must be between 0 and 100% (both are inclusive). |
$alpha | Optional | Specifies the degree of transparency of a color. The arguments must be between -1 and 1 (both are inclusive). |
Return Value
Value | Explanation |
---|---|
color | Returns the changed color. |
Reminder
Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in Sass.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.