--
-- | Read the ~/.hmp3 file, and construct a UIStyle from it, to insert
-- into 
--
buildStyle :: Config -> UIStyle
buildStyle bs = UIStyle {
         window      = f $ hmp3_window      bs
       , helpscreen  = f $ hmp3_helpscreen  bs
       , titlebar    = f $ hmp3_titlebar    bs
       , selected    = f $ hmp3_selected    bs
       , cursors     = f $ hmp3_cursors     bs
       , combined    = f $ hmp3_combined    bs
       , warnings    = f $ hmp3_warnings    bs
       , blockcursor = f $ hmp3_blockcursor bs
       , progress    = f $ hmp3_progress    bs
    }

    where 
        f (x,y) = Style (g x) (g y)
        g x     = case stringToColor x of
                    Nothing -> Default
                    Just y  -> y
buildStyle :: Config -> UIStyle
buildStyle bs = UIStyle {
         window      = f $ hmp3_window      bs
       , helpscreen  = f $ hmp3_helpscreen  bs
       , titlebar    = f $ hmp3_titlebar    bs
       , selected    = f $ hmp3_selected    bs
       , cursors     = f $ hmp3_cursors     bs
       , combined    = f $ hmp3_combined    bs
       , warnings    = f $ hmp3_warnings    bs
       , blockcursor = f $ hmp3_blockcursor bs
       , progress    = f $ hmp3_progress    bs
    }

    where 
        f (x,y) = Style (g x) (g y)
        g x     = case stringToColor x of
                    Nothing -> Default
                    Just y  -> y
buildStyle bs = UIStyle {
         window      = f $ hmp3_window      bs
       , helpscreen  = f $ hmp3_helpscreen  bs
       , titlebar    = f $ hmp3_titlebar    bs
       , selected    = f $ hmp3_selected    bs
       , cursors     = f $ hmp3_cursors     bs
       , combined    = f $ hmp3_combined    bs
       , warnings    = f $ hmp3_warnings    bs
       , blockcursor = f $ hmp3_blockcursor bs
       , progress    = f $ hmp3_progress    bs
    }

    where 
        f (x,y) = Style (g x) (g y)
        g x     = case stringToColor x of
                    Nothing -> Default
                    Just y  -> y