Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] add darker() and lighter() expression functions
- Loading branch information
1 parent
e9ef513
commit a5d6702
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "darker", | ||
"type": "function", | ||
"description": "Returns a darker (or lighter) color string", | ||
"arguments": [ | ||
{"arg":"color", "description":"a color string"}, | ||
{"arg":"factor", "description":"a integer number corresponding to the darkening factor:<ul><li>if the factor is greater than 100, this functions returns a darker color (for e.g., setting factor to 300 returns a color that has one-third the brightness);</li><li>if the factor is less than 100, the return color is lighter, but using the lighter() function for this purpose is recommended;</li><li>if the factor is 0 or negative, the return value is unspecified.</li></ul>"} | ||
], | ||
"examples": [ { "expression":"darker('200,10,30',300)", "returns":"'66,3,10,255'"}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "lighter", | ||
"type": "function", | ||
"description": "Returns a lighter (or darker) color string", | ||
"arguments": [ | ||
{"arg":"color", "description":"a color string"}, | ||
{"arg":"factor", "description":"a integer number corresponding to the lightening factor:<ul><li>if the factor is greater than 100, this functions returns a lighter color (for e.g., setting factor to 150 returns a color that is 50% brighter);</li><li>if the factor is less than 100, the return color is darker, but using the darker() function for this purpose is recommended;</li><li>if the factor is 0 or negative, the return value is unspecified.</li></ul>"} | ||
], | ||
"examples": [ { "expression":"lighter('200,10,30',200)", "returns":"'255,158,168,255'"}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters