Aim is to allow the user to pick a colour visually (specifying the input values and returning a result in the ARGB convention)


∇  xaml←ColorPickerXAML
⍝ XAML for the ColorPicker example
 xaml,←⊂'    xmlns=""'
 xaml,←⊂'    xmlns:x=""'
 xaml,←⊂'    xmlns:sfcolpick="clr-namespace:Syncfusion.Windows.Shared;assembly=SyncFusion.Shared.WPF"'
 xaml,←⊂'    SizeToContent="WidthandHeight" >'
 xaml,←⊂'    <StackPanel>'
 xaml,←⊂'        <sfcolpick:ColorPicker Name="colpick"'
 xaml,←⊂'        IsGradientPropertyEnabled="False" VisualizationStyle="RGB">'
 xaml,←⊂'        </sfcolpick:ColorPicker>'
 xaml,←⊂'    </StackPanel>'


∇  z←ColorPicker w;⎕IO;⎕ML;xaml;⎕USING
⍝ Simple ColorPicker example
 ⎕IO ⎕ML←0 3
 window←#.UTIL.WPF.LoadXaml xaml(⊂'SyncTools')
 window_colorpicker.Color←Color.FromArgb w
 z←window_colorpicker.Color.(A R G B)

Limitations of Windows snipping (or my lack of mastery) means that the display above doesn't show the dropped display which appears when the user clicks on the selection button.

The 'SyncTools' argument to #.UTIL.LoadXAML has the effect of adding 'Syncfusion.Windows.Shared,Syncfusion/4.5/Syncfusion.Shared.WPF.dll' to the ⎕USING list of LoadXAML

Thanks to Pierre Gilbert for the simplification which makes this example work correctly with the most recent (January 2015) version of the Syncfusion libraries supplied by Dyalog.


     #.ColorPicker.ColorPicker 100 255 0 0      
100 255 255 0 

Unresolved Issues

Hue-saturation-brightness (bizarrely called HSV by SyncFusion) as an option.

Gradient mode