{"library":"colorful","code":"import colorful as cf\nimport os\n\n# Basic text styling\nprint(cf.red('Hello, red World!'))\nprint(cf.bold_green('This is bold and green.'))\n\n# Combining styles using bitwise operators\nprint(cf.italic & cf.coral_on_beige | 'Styled with italic, coral text on beige background.')\n\n# Using f-strings (Python >= 3.6)\nuser_name = os.environ.get('USER', 'Guest')\nprint(f'{cf.blue_on_white}Hello, {user_name}! Enjoy Colorful!{cf.reset}')\n\n# Extending the default color palette\ncf.update_palette({'companyOrange': '#f4b942', 'companyBlue': '#4287f5'})\nprint(cf.companyOrange_on_companyBlue('Custom company colors!'))\n\n# Using a context manager for temporary color mode\nwith cf.with_8_ansi_colors() as c:\n    print(c.bold_magenta('This text uses 8 ANSI colors only.'))\n\n# Printing with format-string like syntax\ncf.print('{c.cyan}Formatted {c.underline}output{c.reset} with {c.yellow}placeholders{c.reset}',\n         name=cf.bold_white('Colorful'))\n","lang":"python","description":"This quickstart demonstrates basic text coloring, combining styles, using f-strings for dynamic content, extending the color palette, and employing context managers for specific color modes. The recommended import is `import colorful as cf`.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}