1、下载ColorPicker.dll
2、在项目工程中引入“ColorPicker.dll”库文件(引用—添加引用—浏览—点击浏览按钮,找到下载的“ColorPicker.dll”)
如果在工程中不添加引用,软件就会提示:命名空间“ xmlns:local="clr-namespace:ColorPicker;assembly=ColorPicker" 不存在“ColorPicker”的名称”等错误;
3、调用示例
<Window x:Class="Colorp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ColorPicker;assembly=ColorPicker"
Title="MainWindow" Height="350" Width="525">
<WrapPanel Orientation="Vertical" Background="Black" VerticalAlignment="Top" HorizontalAlignment="Center" Width="525" Margin="10 10">
<local:ColorPicker Margin="20"/>
<local:BindOnEnterTextBox Width="80" Height=" 20" Margin="20"/>
<local:ColorComboBox Margin="20"/>
<local:ColorSlider Margin="20"/>
<local:HsvControl Margin="20" Width="100" Height="50"/>
<local:SpectrumSlider Margin="20" Value="20" Width="50" Height="120"/>
</WrapPanel>
</Window>
4、界面效果图
5、一个简单的颜色选择器 参考地址:https://blog.csdn.net/BYH371256/article/details/83409995