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
12
12
private Color color ;
13
13
private bool hexadecimal ;
14
14
private bool ignoreOnChanged = false ;
15
+ private bool alphaEnabled = true ;
15
16
16
17
public ColorPicker ( )
17
18
{
@@ -29,7 +30,8 @@ public Color Value
29
30
return ;
30
31
color = value ;
31
32
ignoreOnChanged = true ;
32
- nslAlpha . Value = color . A ;
33
+ if ( alphaEnabled )
34
+ nslAlpha . Value = color . A ;
33
35
nslRed . Value = color . R ;
34
36
nslGreen . Value = color . G ;
35
37
nslBlue . Value = color . B ;
@@ -43,6 +45,23 @@ public Color Value
43
45
public byte Blue { get ; private set ; }
44
46
public byte Alpha { get ; private set ; }
45
47
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
+
46
65
public bool Hexadecimal
47
66
{
48
67
get { return hexadecimal ; }
You can’t perform that action at this time.
0 commit comments