[gtk+/gtk-3-22] css-overview: Fix+Explain color expr number ranges
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] css-overview: Fix+Explain color expr number ranges
- Date: Sat, 18 Mar 2017 01:18:24 +0000 (UTC)
commit b73e6ffbd852fef3f1982239985fd70d85a69bba
Author: Daniel Boles <dboles src gnome org>
Date: Sat Mar 18 01:13:42 2017 +0000
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
docs/reference/gtk/css-overview.xml | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/docs/reference/gtk/css-overview.xml b/docs/reference/gtk/css-overview.xml
index 6e4f4b0..0706f16 100644
--- a/docs/reference/gtk/css-overview.xml
+++ b/docs/reference/gtk/css-overview.xml
@@ -584,12 +584,16 @@ background-color: @bg_color;
<para>
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.
+ Color expressions resemble functions, taking 1 or more colors and in some
+ cases a number as arguments.
</para>
<para>
- Color expressions resemble functions, taking 1 or more colors and in some
- cases a number as their arguments. The number is floating-point, clamped
- between 0 and 1, and specifies the degree to which the expression will
- transform the given color(s) in the manner that is indicated by its name.
+ shade() leaves the color unchanged when the number is 1 and transforms it
+ to black or white as the number approaches 0 or 2 respectively. For mix(),
+ 0 or 1 return the unaltered 1st or 2nd color respectively; numbers between
+ 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>
<literallayout><code>〈color expression〉 = lighter(〈color〉) | darker(〈color〉) | shade(〈color〉,〈number〉) |
alpha(〈color〉,〈number〉) | mix(〈color〉,〈color〉,〈number〉)</code>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]