[]
TypeConverter that converts Blend objects to and from strings.
public class BlendConverter : TypeConverter
The Blend object is converted to a string with the following format:
[p1],[f1];[p2],[f2];...;[pn],[fn]
Where the 'pi' are positions between 0 and 1 along the blend line and 'fi' are factors between 0 and 1 that correspond to the amount of the secondary color in the blend.
The positions must be increasing, and the last one must be 1.
This converter allows persisting Blend objects to Xml.
These are some simple blend strings:
"0,0;1,1": default blend, starting with color1 (0,0) and finishing with color2 (1,1).
"0,1;1,0": reverse blend, starting with color2 (1,0) and finishing with color1 (0,1).
"0,0;.5,1;1,0": starts with color1, switches to color2 halfway, then back to color1.
"0,0;.1,1;.9,1;1,0": starts with color1, switches to color2 at 10%, continues with color2 up to 90%, then switches back to color1.
Name | Description |
---|---|
BlendConverter() |