def colorize_string(string, color): """ This function applies the provided color to the specified string Arguments: msg - The message to be colored color - The name of the color (or hex code), e.g., "red" or "#C0C0C0" Returns: A colored message """ return set_fg(color) + string + reset()
# -*- encoding: utf-8 -*- # kb v0.1.6 # A knowledge base organizer # Copyright © 2020, gnc. # See /LICENSE for licensing information. """ kb printer style module for constants :Copyright: © 2020, gnc. :License: GPLv3 (see /LICENSE). """ from typing import List import kb.styler as styler from kb.entities.artifact import Artifact ALT_BGROUND = styler.set_bg('#303030') BOLD = styler.set_style('bold') UND = styler.set_style('underlined') RESET = styler.reset()