Focusable = true;
Background = DimGray;
}
+Spinner {
+ Foreground = DimGray;
+}
TabView {
CacheEnabled = false;
}
<?xml version="1.0"?>
<HorizontalStack MinimumSize="40,10" Name="hstack" Margin="0" Spacing="0">
<Border BorderWidth="1" Width="80%" Background="White"
- Foreground="DimGray" Margin="0">
- <Label Foreground="DimGray" Width="Stretched"
+ Foreground="{./Foreground}" Margin="0">
+ <Label Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
Text="{./Value}" TextAlignment="Right" Margin="0"/>
</Border>
<VerticalStack MinimumSize="8,10" Width="20%" Height="Stretched" Spacing="0" Margin="0" Background="Red">
{
return new Color (this.R, this.G, this.B, _A);
}
+ public void ResetName(){
+ Name = "";
+ }
#region Predefined colors
public static readonly Color Transparent = new Color(0, 0, 0, 0, "Transparent");
}
public static Color FromHSV(double _h, double _v = 1.0, double _s = 1.0){
Color c = Color.Black;
-
+ c.ResetName ();
if (_s == 0) {//HSV from 0 to 1
c.R = _v;
c.G = _v;
if (!items.ContainsKey (key))
return default(T);
Type type = typeof(T);
- MethodInfo miParse = type.GetMethod ("Parse", BindingFlags.Static);
+ MethodInfo miParse = type.GetMethod ("Parse", new Type[] {typeof(string)});
if (miParse == null)
return (T)Convert.ChangeType (items [key], typeof(T));
hsvFromRGB ();
}
}
-
+ [XmlAttributeAttribute]
+ public virtual Color SelectedRawColor {
+ get { return curColor; }
+ set {
+ if (curColor == value)
+ return;
+ curColor = value;
+ notifyCurColorHasChanged ();
+ notifyRGBAHasChanged ();
+ hsvFromRGB ();
+ }
+ }
void notifyCurColorHasChanged(){
NotifyValueChanged ("SelectedColor", SelectedColor);
+ NotifyValueChanged ("SelectedRawColor", curColor);
string n = curColor.ToString ();
if (char.IsLetter(n[0]))
NotifyValueChanged ("SelectedColorName", n);
}
void hsvFromRGB(){
Color c = curColor;
+ c.ResetName ();
double min = Math.Min (c.R, Math.Min (c.G, c.B)); //Min. value of RGB
double max = Math.Max (c.R, Math.Max (c.G, c.B)); //Max. value of RGB
double diff = max - min; //Delta RGB value
}
void rgbFromHSV(){
Color c = Color.Black;
-
+ c.ResetName ();
if (s == 0) {//HSV from 0 to 1
c.R = v;
c.G = v;