diff --git a/Terminal.Gui/Drawing/ColorScheme.cs b/Terminal.Gui/Drawing/ColorScheme.cs index 8ced1bdead..d2acdab5ca 100644 --- a/Terminal.Gui/Drawing/ColorScheme.cs +++ b/Terminal.Gui/Drawing/ColorScheme.cs @@ -48,6 +48,21 @@ public ColorScheme (Attribute attribute) _hotFocus = attribute; } + /// Creates a new instance, initialized with the values provided. + public ColorScheme ( + Attribute normal, + Attribute focus, + Attribute hotNormal, + Attribute disabled, + Attribute hotFocus) + { + _normal = normal; + _focus = focus; + _hotNormal = hotNormal; + _disabled = disabled; + _hotFocus = hotFocus; + } + /// The default foreground and background color for text when the view is disabled. public Attribute Disabled { diff --git a/UnitTests/Drawing/ColorSchemeTests.cs b/UnitTests/Drawing/ColorSchemeTests.cs index 7675235f17..05ac1b7a99 100644 --- a/UnitTests/Drawing/ColorSchemeTests.cs +++ b/UnitTests/Drawing/ColorSchemeTests.cs @@ -38,4 +38,27 @@ public void ColorScheme_New () lbl.ColorScheme = scheme; lbl.Draw (); } + + [Fact] + public void ColorScheme_BigConstructor () + { + var a = new Attribute (1); + var b = new Attribute (2); + var c = new Attribute (3); + var d = new Attribute (4); + var e = new Attribute (5); + + var cs = new ColorScheme ( + normal: a, + focus: b, + hotNormal: c, + disabled: d, + hotFocus: e); + + Assert.Equal (a, cs.Normal); + Assert.Equal (b, cs.Focus); + Assert.Equal (c, cs.HotNormal); + Assert.Equal (d, cs.Disabled); + Assert.Equal (e, cs.HotFocus); + } }