File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -34,18 +34,31 @@ namespace ColorSetKit
3434 [ MarkupExtensionReturnType ( typeof ( SolidColorBrush ) ) ]
3535 public partial class Color : MarkupExtension
3636 {
37- public Color ( string name )
37+ public Color ( string name ) : this ( name , false )
38+ { }
39+
40+ public Color ( string name , bool variant )
3841 {
39- this . Name = name ;
42+ this . Name = name ;
43+ this . Variant = variant ;
4044 }
4145
4246 public override object ProvideValue ( IServiceProvider provider )
4347 {
44- return ColorSet . Shared . ColorNamed ( this . Name ) ? . Color ;
48+ ColorPair color = ColorSet . Shared . ColorNamed ( this . Name ) ;
49+
50+ return this . Variant && color ? . Variant is SolidColorBrush variant ? variant : color ? . Color ;
4551 }
4652
4753 [ ConstructorArgument ( "name" ) ]
4854 public string Name
55+ {
56+ get ;
57+ set ;
58+ }
59+
60+ [ ConstructorArgument ( "variant" ) ]
61+ public bool Variant
4962 {
5063 get ;
5164 set ;
You can’t perform that action at this time.
0 commit comments