css-overview: Fix+Explain color expr number ranges
Last try, promise. They don’t all use 0 to 1. We should probably explain the effects too. Hopefully this manages that while not being too verbose
This commit is contained in:
@@ -584,12 +584,16 @@ background-color: @bg_color;
|
|||||||
<para>
|
<para>
|
||||||
GTK+ also supports color expressions, which allow colors to be transformed
|
GTK+ also supports color expressions, which allow colors to be transformed
|
||||||
to new ones and can be nested, providing a rich language to define colors.
|
to new ones and can be nested, providing a rich language to define colors.
|
||||||
|
Color expressions resemble functions, taking 1 or more colors and in some
|
||||||
|
cases a number as arguments.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Color expressions resemble functions, taking 1 or more colors and in some
|
shade() leaves the color unchanged when the number is 1 and transforms it
|
||||||
cases a number as their arguments. The number is floating-point, clamped
|
to black or white as the number approaches 0 or 2 respectively. For mix(),
|
||||||
between 0 and 1, and specifies the degree to which the expression will
|
0 or 1 return the unaltered 1st or 2nd color respectively; numbers between
|
||||||
transform the given color(s) in the manner that is indicated by its name.
|
0 and 1 return blends of the two; and numbers below 0 or above 1 intensify
|
||||||
|
the RGB components of the 1st or 2nd colour respectively. alpha() takes a
|
||||||
|
number from 0 to 1 and applies that as the opacity of the supplied color.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<literallayout><code>〈color expression〉 = lighter(〈color〉) | darker(〈color〉) | shade(〈color〉,〈number〉) | alpha(〈color〉,〈number〉) | mix(〈color〉,〈color〉,〈number〉)</code>
|
<literallayout><code>〈color expression〉 = lighter(〈color〉) | darker(〈color〉) | shade(〈color〉,〈number〉) | alpha(〈color〉,〈number〉) | mix(〈color〉,〈color〉,〈number〉)</code>
|
||||||
|
|||||||
Reference in New Issue
Block a user