]> O.S.I.I.S - jp/crow.git/commitdiff
Hex color value
authorjpbruyere <jp.bruyere@hotmail.com>
Thu, 20 Oct 2016 12:48:43 +0000 (14:48 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Thu, 20 Oct 2016 12:48:43 +0000 (14:48 +0200)
modifié :         Templates/ColorPicker.template
modifié :         src/GraphicObjects/ColorSelector.cs

Templates/ColorPicker.template
src/GraphicObjects/ColorSelector.cs

index 00f70544d8b043bedb8146f2d30190ac8bdcbaba..06753f80d33488974b5c95377ff9c32a6c52376c 100755 (executable)
@@ -2,15 +2,18 @@
 <Border Background="{./Background}"    Foreground="{./Foreground}"
                CornerRadius="{./CornerRadius}" BorderWidth="1">
                <HorizontalStack Spacing="0">
-                       <VerticalStack Margin="5">
-                               <SaturationValueSelector Focusable="true" Name="colorSelector" Margin="0" Width="200" Height="200" Background="DimGray"
+                       <VerticalStack Margin="10">
+                               <SaturationValueSelector Focusable="true" Name="colorSelector" Margin="0" Width="140" Height="140" Background="DimGray"
                                        Foreground="{../hueSelector.SelectedColor}"/>
-                               <HueSelector Focusable="true" Name="hueSelector" Margin="0" Width="200" Height="20" Background="DimGray"/>
+                               <HueSelector Focusable="true" Name="hueSelector" Margin="0" Width="140" Height="20" Background="DimGray"/>
                        </VerticalStack>
                        <VerticalStack Margin="5" Height="Stretched">
                                <HorizontalStack Height="Fit" Width="Stretched">
-                                       <GraphicObject Width="40" Height="40" Background="{../../../colorSelector.SelectedColor}"/>
-                                       <Label Width="Stretched" Background="Jet" Text="{../../../colorSelector.SelectedColorName}" TextAlignment="Center"/>
+                                       <GraphicObject Width="30" Height="30" Background="{../../../colorSelector.SelectedColor}"/>
+                                       <VerticalStack Margin="5">
+                                               <Label Focusable="true" Selectable="true" Width="Stretched" Text="{../../../../colorSelector.SelectedColorName}" />
+                                               <Label Focusable="true" Selectable="true" Width="Stretched" Text="{../../../../colorSelector.HexColor}" />
+                                       </VerticalStack>
                                </HorizontalStack>
                                <HorizontalStack Height="Fit">
                                        <Label Text="Red:" Width="50"/>
index 3630ea2f51a6d0d052b1635df54ac94ae10e221a..6db139a53fb6ab5e051d8d62b4a13c85286d1ec7 100644 (file)
@@ -132,6 +132,7 @@ namespace Crow
                                        NotifyValueChanged ("SelectedColorName", n);
                                else
                                        NotifyValueChanged ("SelectedColorName", "-");
+                               NotifyValueChanged ("HexColor", ((int)R).ToString ("X") + ((int)G).ToString ("X") + ((int)B).ToString ("X") + ((int)A).ToString ("X"));
                        }
                }