Answers for "python how to specify colours"

3

simple colours python

pip install simple-colors

from simple_colors import *

print(green('hello'))
print(green('hello', 'bold'))
print(green('hello', ['bold', 'underlined']))
Posted by: Guest on March-30-2020
1

python colours

const (
    ResetAll = "33[0m"

    Bold       = "33[1m"
    Dim        = "33[2m"
    Underlined = "33[4m"
    Blink      = "33[5m"
    Reverse    = "33[7m"
    Hidden     = "33[8m"

    ResetBold       = "33[21m"
    ResetDim        = "33[22m"
    ResetUnderlined = "33[24m"
    ResetBlink      = "33[25m"
    ResetReverse    = "33[27m"
    ResetHidden     = "33[28m"

    Default      = "33[39m"
    Black        = "33[30m"
    Red          = "33[31m"
    Green        = "33[32m"
    Yellow       = "33[33m"
    Blue         = "33[34m"
    Magenta      = "33[35m"
    Cyan         = "33[36m"
    LightGray    = "33[37m"
    DarkGray     = "33[90m"
    LightRed     = "33[91m"
    LightGreen   = "33[92m"
    LightYellow  = "33[93m"
    LightBlue    = "33[94m"
    LightMagenta = "33[95m"
    LightCyan    = "33[96m"
    White        = "33[97m"

    BackgroundDefault      = "33[49m"
    BackgroundBlack        = "33[40m"
    BackgroundRed          = "33[41m"
    BackgroundGreen        = "33[42m"
    BackgroundYellow       = "33[43m"
    BackgroundBlue         = "33[44m"
    BackgroundMagenta      = "33[45m"
    BackgroundCyan         = "33[46m"
    BackgroundLightGray    = "33[47m"
    BackgroundDarkGray     = "33[100m"
    BackgroundLightRed     = "33[101m"
    BackgroundLightGreen   = "33[102m"
    BackgroundLightYellow  = "33[103m"
    BackgroundLightBlue    = "33[104m"
    BackgroundLightMagenta = "33[105m"
    BackgroundLightCyan    = "33[106m"
    BackgroundWhite        = "33[107m"
)
Posted by: Guest on October-21-2020

Python Answers by Framework

Browse Popular Code Answers by Language