Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #565 from nyalldawson/new_functions
New color functions (from hsl, hsv and cmyk), new regexp_match function
- Loading branch information
Showing
10 changed files
with
278 additions
and
5 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,17 @@ | ||
|
||
<h3>color_cmyk() function</h3> | ||
Returns a string representation of a color based on its cyan, magenta, yellow and black components | ||
|
||
<p><h4>Syntax</h4> | ||
color_cmyk(<i>cyan, magenta, yellow, black</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br> | ||
<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br> | ||
<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br> | ||
<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br> | ||
|
||
<p><h4>Example</h4> | ||
<!-- Show example of function.--> | ||
color_cmyk(100,50,0,10) → '#0073e6'</p> |
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,18 @@ | ||
|
||
<h3>color_cmyka() function</h3> | ||
Returns a string representation of a color based on its cyan, magenta, yellow, black and alpha (transparency) components | ||
|
||
<p><h4>Syntax</h4> | ||
color_cmyka(<i>cyan, magenta, yellow, black, alpha</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> cyan</i> → the cyan component of the color, as a percentage integer value from 0 to 100.<br> | ||
<i> magenta</i> → the magenta component of the color, as a percentage integer value from 0 to 100.<br> | ||
<i> yellow</i> → the yellow component of the color, as a percentage integer value from 0 to 100.<br> | ||
<i> black</i> → the black component of the color, as a percentage integer value from 0 to 100.<br> | ||
<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br> | ||
|
||
<p><h4>Example</h4> | ||
<!-- Show example of function.--> | ||
color_cmyka(100,50,0,10,200) → '0,115,230,200'</p> |
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,16 @@ | ||
|
||
<h3>color_hsl() function</h3> | ||
Returns a string representation of a color based on its hue, saturation, and lightness attributes | ||
|
||
<p><h4>Syntax</h4> | ||
color_hsl(<i>hue, saturation, lightness</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br> | ||
<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br> | ||
<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br> | ||
|
||
<p><h4>Example</h4> | ||
<!-- Show example of function.--> | ||
color_hsl(100,50,70) → '#a6d98c'</p> |
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,17 @@ | ||
|
||
<h3>color_hsla() function</h3> | ||
Returns a string representation of a color based on its hue, saturation, lightness and alpha (transparency) attributes | ||
|
||
<p><h4>Syntax</h4> | ||
color_hsla(<i>hue, saturation, lightness, alpha</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br> | ||
<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br> | ||
<i> lightness</i> → the lightness percentage of the color as an integer value from 0 to 100.<br> | ||
<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br> | ||
|
||
<p><h4>Example</h4> | ||
<!-- Show example of function.--> | ||
color_hsla(100,50,70,200) → '166,217,140,200'</p> |
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,16 @@ | ||
|
||
<h3>color_hsv() function</h3> | ||
Returns a string representation of a color based on its hue, saturation, and value attributes | ||
|
||
<p><h4>Syntax</h4> | ||
color_hsv(<i>hue, saturation, value</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br> | ||
<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br> | ||
<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br> | ||
|
||
<p><h4>Example</h4> | ||
<!-- Show example of function.--> | ||
color_hsv(40,100,100) → '#ffaa00'</p> |
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,17 @@ | ||
|
||
<h3>color_hsva() function</h3> | ||
Returns a string representation of a color based on its hue, saturation, value and alpha (transparency) attributes | ||
|
||
<p><h4>Syntax</h4> | ||
color_hsva(<i>hue, saturation, value, alpha</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> hue</i> → the hue of the color, as an integer value from 0 to 360.<br> | ||
<i> saturation</i> → the saturation percentage of the color as an integer value from 0 to 100.<br> | ||
<i> value</i> → the value percentage of the color as an integer from 0 to 100.<br> | ||
<i> alpha</i> → the alpha component as an integer value from 0 (completely transparent) to 255 (opaque).<br> | ||
|
||
<p><h4>Example</h4> | ||
<!-- Show example of function.--> | ||
color_hsva(40,100,100,200) → '255,170,0,200'</p> |
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,14 @@ | ||
<h3>regexp_match() function</h3> | ||
Returns true if any part of a string matches the supplied regular expression. | ||
|
||
<p><h4>Syntax</h4> | ||
regexp_match(<i>string,regex</i>)</p> | ||
|
||
<p><h4>Arguments</h4> | ||
<!-- List args for functions here--> | ||
<i> string</i> → is string. The string to test against the regular expression.<br> | ||
<i> regex</i> → is string. The regular expression to test against. Backslash characters must be double escaped (eg "\\s" to match a white space character).<br> | ||
|
||
<p><h4>Example</h4> | ||
<!-- Show example of function.--> | ||
regexp_match('QGIS ROCKS','\\sROCKS') → 1</p> |
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
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