on master help sign in
withStyle: leave style untouched if added style is zero
commitb9572e64b028f55e93f781353ed02f0f9918338e authorJonathan Daugherty <cygnus@foobox.com> dateSat 2 Sep 2017, 13:24 (9 years ago) parentd14aae9
1 file changed+1
src/Graphics/Vty/Attributes.hs+1
src/Graphics/Vty/Attributes.hs+1
@@ -200,6 +200,7 @@ withBackColor attr c = attr { attrBackColor = SetTo c }
200200
201201-- | Add the given style attribute
202202withStyle :: Attr -> Style -> Attr
203+withStyle attr 0 = attr
203204withStyle attr styleFlag = attr { attrStyle = SetTo $ styleMask attr .|. styleFlag }
204205
205206-- | Sets the style, background color and foreground color to the