-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorPickerWindow.xaml
More file actions
96 lines (89 loc) · 4.4 KB
/
Copy pathColorPickerWindow.xaml
File metadata and controls
96 lines (89 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<Window x:Class="QrCodeGenerator.ColorPickerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Pick a color" Height="560" Width="420"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
Background="{StaticResource Bg}"
FontFamily="Segoe UI" FontSize="13">
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Preview + hex -->
<Grid Grid.Row="0" Margin="0,0,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="12"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" x:Name="PreviewSwatch" Width="72" Height="72" CornerRadius="8"
BorderBrush="{StaticResource Border}" BorderThickness="1"/>
<StackPanel Grid.Column="2" VerticalAlignment="Center">
<TextBlock Text="Hex" Style="{StaticResource Label}"/>
<TextBox x:Name="HexBox" TextChanged="HexBox_TextChanged"/>
</StackPanel>
</Grid>
<!-- RGB -->
<Grid Grid.Row="1" Margin="0,0,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
<TextBlock Text="R" Style="{StaticResource Label}"/>
<TextBox x:Name="RBox" TextChanged="Rgb_TextChanged"/>
</StackPanel>
<StackPanel Grid.Column="2">
<TextBlock Text="G" Style="{StaticResource Label}"/>
<TextBox x:Name="GBox" TextChanged="Rgb_TextChanged"/>
</StackPanel>
<StackPanel Grid.Column="4">
<TextBlock Text="B" Style="{StaticResource Label}"/>
<TextBox x:Name="BBox" TextChanged="Rgb_TextChanged"/>
</StackPanel>
</Grid>
<!-- Contrast hint (shown only when a pair color is given) -->
<Border Grid.Row="2" x:Name="ContrastPanel" Background="{StaticResource Card}"
BorderBrush="{StaticResource Border}" BorderThickness="1" CornerRadius="8"
Padding="10" Margin="0,0,0,12" Visibility="Collapsed">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="12"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" x:Name="ContrastSample" Width="64" Height="40" CornerRadius="6"
BorderBrush="{StaticResource Border}" BorderThickness="1">
<TextBlock x:Name="ContrastSampleText" Text="▚▞" HorizontalAlignment="Center"
VerticalAlignment="Center" FontWeight="Bold"/>
</Border>
<StackPanel Grid.Column="2" VerticalAlignment="Center">
<TextBlock x:Name="ContrastText" FontWeight="SemiBold"/>
<TextBlock x:Name="ContrastAdvice" Style="{StaticResource Dim}"/>
</StackPanel>
</Grid>
</Border>
<TextBlock Grid.Row="3" Text="Palette" Style="{StaticResource Label}"/>
<WrapPanel Grid.Row="4" x:Name="PalettePanel" Margin="0,0,0,4"/>
<!-- spacer row 5 -->
<Grid Grid.Row="6" Margin="0,12,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="1" Content="Cancel" Margin="0,0,8,0" Click="CancelButton_Click"/>
<Button Grid.Column="2" Content="Use color" Style="{StaticResource Primary}" Click="UseButton_Click"/>
</Grid>
</Grid>
</Window>