Template:HSLtoRGB.G

From blackwiki
Revision as of 02:37, 31 December 2006 by imported>Verdy p (Created page with '<includeonly>:''The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.''{{Template documentation}}</includeonly><noinclude>:''This is t...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This is the documentation of Template:HSLtoRGB.G.

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
  • "{{HSLtoRGB.G|0|0|0}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|0|0|1}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|0|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|0.2|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|30|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|60|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|90|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|120|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|150|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|180|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|210|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|217.2|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|240|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|270|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|300|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|330|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

  • "{{HSLtoRGB.G|359.8|1|0.5}}" returns "
The documentation of this template is transcluded from Template:HSLtoRGB.G/doc.Template:Template documentation

This template computes the green value in [0..255] in the sRGB color space (as defined in standard CSS3), from a color specified in the HSL color space. The returned value is rounded to the nearest integer.

Syntax
{{HSLtoRGB.G|H|S|L}}
The standard range of the hue parameter (H) is normally [0..360) but can be any value in degrees ; it can be any numeric expressions.
The range of the saturation and lightness parameters (S and L) is [0..1], not percentages in [0..100]% ; they can be any numeric expressions.
When the lightness parameter (L) equals 0 or 1, the color is plain black or plain white (respectively), and the value of the hue and saturation parameters (H and S) can be any numeric value (however, black or white are typically specified with H=0, S=0).
When the saturation parameter (S) equals 0, the color is a gray shade between black and white without chromatic value, and the value of the hue parameter (H) can be any numeric value (however, gray shades are typically specified as H=0).
When the saturation parameter (S) equals 1, and lightness (L) is not 0 or 1, the hue parameter varying from 0 to 360 generates the full circle of saturated colors (when lightness equals 0.5, the circle with the greatest number of distinct colors is generated).
{{subst:HSLtoRGB.G|H|S|L|subst=subst:}}
To replace the template invokation by the computed value when saving an article Wiki source.
Algorithm used
if H mod 360 > 180 then
if H mod 360 > 240 then
if L > 0.5
then G = L - S * (1 - L);
else G = (1 - S) * L;
else
if L > 0.5
then G = L - (1 - (240 - H mod 360) / 30) * S * (1 - L));
else G = (1 - (1 - (240 - H mod 360) / 30) * S) * L;
else
if H mod 360 > 60 then
if L > 0.5
then G = L + S * (1 - L);
else G = (1 + S) * L;
else
if L > 0.5
then G = L - (1 - H mod 360) / 30) * S * (1 - L);
else G = (1 - (1 - H mod 360) / 30) * S) * L;
return (G * 255) round 0;
Examples
See also

".

See also