Themes: fix a bug that prevented bright colors from being parsed in theme files

This commit is contained in:
Jonathan Daugherty 2017-12-05 17:04:20 -08:00
parent a6cabf218f
commit 15a77fe15d

View File

@ -191,10 +191,11 @@ isNullCustomization c =
parseColor :: T.Text -> Either String (MaybeDefault Color)
parseColor s =
let stripped = T.strip $ T.toLower s
normalize (t, c) = (T.toLower t, c)
in if stripped == "default"
then Right Default
else maybe (Left $ "Invalid color: " <> show s) (Right . SetTo) $
lookup stripped (swap <$> allColors)
else maybe (Left $ "Invalid color: " <> show stripped) (Right . SetTo) $
lookup stripped (normalize <$> swap <$> allColors)
allColors :: [(Color, T.Text)]
allColors =