dims,
colors,
and
borders<dim id="border-size">2.0</dim> <dim id="unlimited">inf</dim> <color id="left-border-color"> <r>1</r> <g>.5</g> <b>.0</b> </color> <border id="solid-border"> <color>left-border-color</color> <width>border-size</width> <height>border-size</height> </border>
dimensions specify sizes of various UI
elements,
A dim element specifies a size in millimeters,
which can be fractional, and calculates the number of pixels closest
to the given size, taking into account the
current theme's scale.
This is the same as setting a
x::w::dim_arg
from the given value.
A special value of “inf” evaluates to a
NAN, and used in contexts of specifying an unlimited
maximum widget size.
colors define colors in terms of their
red,
ggreen,
bblue, and
aalpha (transparency) values.
Each component ranges from 0 (none) to 1.0 (maximum intensity).
This is the same as setting
x::w::color_arg
from an
x::w::rgb
whose values are scaled from 0 to
x::w::rgb::maximum with 1.0
as x::w::rgb::maximum.
Other parts of the theme file refer to dimensions and colors by their
ids:
<border id="solid-border"> <color>left-border-color</color> <width>border-size</width> <height>border-size</height> </border>
A border element defines a border,
effectively initializing a
x::w::border_arg
from a
x::w::border_infomm.
The border contains the following elements:
width
This dimension sets
x::w::border_infomm's
width.
height
This dimension sets
x::w::border_infomm's
height.
rounded<rounded /> <rounded>1</rounded> <rounded>0</rounded>
This sets
x::w::border_infomm's
rounded (an empty tag is equivalent to 1).
hradius
This dimension sets
x::w::border_infomm's
hradius.
vradius
This dimension sets
x::w::border_infomm's
vradius.
width_scale,
height_scale,
hradius_scale, and
vradius_scale
These elements' values set
x::w::border_infomm's
corresponding members.
color
This color sets
x::w::border_infomm's
color1.
This is the border's primary color.
color2
This color sets
x::w::border_infomm's
color2.
This is an optional secondary color for drawing dashed
borders.
dash
This element can appear more than once, and initializes
x::w::border_infomm's
dashes. This creates a border that's drawn as
a dashed line instead of a solid
color.
dashes are literal values, not
dims; and
dashes' values are
literal floating point values.
dims,
colors,
and
borders from the default theme
Like with all other elements, the relative order of
dims,
colors,
and
borders, relative to each other and other
elements in the theme file, does not matter, except that the first
unique
id takes priority over other elements
with the same
id which get ignored.
ids that are not defined in the theme
file are presumed to be referring to the ones specifies by the
current default theme.
colors,
and
borders
All theme files can reference the following
colors:
“transparent”, with 0
r,
g,
b, and
a values, and the following standard
HTML 3.2 colors:
“black”,
“gray”,
“silver”,
“white”,
“maroon”,
“red”,
“olive”,
“yellow”,
“green”,
“lime”,
“teal”,
“aqua”,
“navy”,
“blue”,
“fuchsia”,
“purple”.
<color id="bgcolor" scale="gray" /> <color id="bgcolor2" scale="gray"> <r>1.2</r> </color> <border id="dashed-border" from="solid-border"> <color>green</color> <color2>blue</color2> <dash>.75</dash> <rounded>1</rounded> </border>
Declaring a
color with a
scale attribute creates a new alias for another
color in the theme file. This copies the
r,
g,
b, and
a values from the other color, and
multiplies them by the values in the scaled alias, if specified.
The above example creates a bgcolor2 from a
bgcolor, with the
red component multiplied by 1.2 (20%
higher red channel). The scaled component values get automatically
truncated to the range of 0 to 1.
Similarly, declaring a
border with a
from attribute creates a new border based
on another border, with any given values replacing the values from
the other border, with one exception: declaring a new color
color replaces the
color from the original border, and resets
the new border's color2, unless the new
border also specifies an explicit color2;
and specifying the new border's color2
requires
explicitly specifying its color, also.
<border id="solid-border" from="dashed-border"> <dash/> <rounded>0</rounded> </border>
An empty dash in a derived
border removes the inherited dashes.