How to create a color canvas for color picker (wpf)

后端 未结 1 692
醉酒成梦
醉酒成梦 2020-12-11 10:39

I want to create a custom color picker like in Visual Studio or Blend or here (http://www.codeproject.com/Articles/779105/Color-Canvas-and-Color-Picker-WPF-Toolkit). And I h

1条回答
  •  眼角桃花
    2020-12-11 11:45

    The hue bar can be created with a regular LinearGradientBrush. The Level/Saturation panel can be done with a LinearGradientBrush of the appropriate color along the X axis and another as an opacity mask along the Y, with the whole thing drawn against a black background.

    
    
        
        #00FF00
    
        
            
                
                
                
                
                
                
                
            
        
    
        
            
                
                    
                        
                            
                                
                                    
                                    
                                
                            
                        
                        
                            
                                
                                    
                                    
                                
                            
                        
                    
                
            
        
    
    
    
    
        
        
    
    

    Result:

    0 讨论(0)
提交回复
热议问题