Skip to content

Instantly share code, notes, and snippets.

@SnowyPainter
Created June 20, 2020 16:06
Show Gist options
  • Save SnowyPainter/5ab8965d135b96c4e2aeb7e3bfb60e41 to your computer and use it in GitHub Desktop.
Save SnowyPainter/5ab8965d135b96c4e2aeb7e3bfb60e41 to your computer and use it in GitHub Desktop.
<UserControl x:Class="ColorPicker"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ColorPicker"
mc:Ignorable="d" Height="269" Width="400">
<StackPanel x:Name="PickerPanel" Orientation="Vertical" Background="White">
<Grid HorizontalAlignment="Stretch" Height="210" MouseDown="RgbGradient_MouseDown">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="1"/>
<GradientStop Color="White"/>
<GradientStop x:Name="MiddleStop" Color="#FF787878" Offset="0.5"/>
</LinearGradientBrush>
</Grid.Background>
</Grid>
<Grid x:Name="SpectrumGrid" Height="40" MouseLeftButtonDown="SpectrumGrid_MouseLeftButtonDown">
</Grid>
<TextBlock x:Name="HexCode" TextWrapping="Wrap"/>
</StackPanel>
</UserControl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment