def load_theme_from_dict(dict_theme):
t = Default()<EOL>for question_type, settings in dict_theme.items():<EOL><INDENT>if question_type not in vars(t):<EOL><INDENT>raise ThemeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(question_type))<EOL><DEDENT>question_fields = list(filter(lambda x: not x.startswith('<STR_LIT:_>'),<EOL>vars(getattr(t, question_type))))<EOL>for field, value in settings.items():<EOL><INDENT>if field not in question_fields:<EOL><INDENT>raise ThemeError('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(field, question_type))<EOL><DEDENT>actual_value = getattr(term, value) or value<EOL>setattr(getattr(t, question_type), field, actual_value)<EOL><DEDENT><DEDENT>return t<EOL>
Load a theme from a dict.
Expected format:
{
    "Question": {
        "mark_color": "yellow",
        "brackets_color": "normal",
        ...
    },
    "List": {
        "selection_color": "bold_blue",
        "selection_cursor": "->"
    }
}

Color values should be string representing valid blessings.Terminal colors.