File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
src/editors/xrSdkControls/Controls/ColorPicker Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public sealed partial class ColorPicker : UserControl
1212 private Color color ;
1313 private bool hexadecimal ;
1414 private bool ignoreOnChanged = false ;
15+ private bool alphaEnabled = true ;
1516
1617 public ColorPicker ( )
1718 {
@@ -29,7 +30,8 @@ public Color Value
2930 return ;
3031 color = value ;
3132 ignoreOnChanged = true ;
32- nslAlpha . Value = color . A ;
33+ if ( alphaEnabled )
34+ nslAlpha . Value = color . A ;
3335 nslRed . Value = color . R ;
3436 nslGreen . Value = color . G ;
3537 nslBlue . Value = color . B ;
@@ -43,6 +45,23 @@ public Color Value
4345 public byte Blue { get ; private set ; }
4446 public byte Alpha { get ; private set ; }
4547
48+ public bool AlphaEnabled
49+ {
50+ get { return alphaEnabled ; }
51+ set
52+ {
53+ if ( alphaEnabled == value )
54+ return ;
55+ alphaEnabled = value ;
56+ ignoreOnChanged = true ;
57+ nslAlpha . Value = nslAlpha . Maximum ;
58+ ignoreOnChanged = false ;
59+ UpdateColor ( ) ;
60+ lAlpha . Enabled = alphaEnabled ;
61+ nslAlpha . Enabled = alphaEnabled ;
62+ }
63+ }
64+
4665 public bool Hexadecimal
4766 {
4867 get { return hexadecimal ; }
You can’t perform that action at this time.
0 commit comments