diff --git a/color/README.md b/color/README.md new file mode 100644 index 0000000..c6de5ca --- /dev/null +++ b/color/README.md @@ -0,0 +1,12 @@ +```python +color = lambda ansi, text: f"\x1b[{ansi}m{text}\x1b[0m" +for name, ansi in zip("red green yellow blue magenta cyan".split(), range(91, 97)): + setattr(color, name, lambda text, ansi=ansi: color(ansi, text)) + +print(color.red("Red")) +print(color.green("Green")) +print(color.yellow("Yellow")) +print(color.blue("Blue")) +print(color.magenta("Magenta")) +print(color.cyan("Cyan")) +``` \ No newline at end of file