Skip to content

Commit

Permalink
feat: add function show_complex_color prints all avaiable colors
Browse files Browse the repository at this point in the history
* This function prints all available colors with a number.
* Printed colors in the console **automatically adjust** to the size
of your window. You can shrink or enlarge the console window to
adjust the corresponding view.

This feature is just an example of the available colors that you can
use in your project.

There will be a function to use these colors soon.
  • Loading branch information
mdsanima committed Jun 3, 2021
1 parent 3c7080f commit 437969a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/mdsanima_dev/colors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
# Colors Module
Definitions of the colors printed in to console output.
"""


def show_complex_color():
"""
This function prints all available colors with a number.
Returns:
console_print: Show all colors.
Usage:
.. code::
show_complex_color()
"""
# Define color console variables.
sx = '\x1b[38;5;'
ex = '\x1b[0m'

# Print all colors with numbers.
for i in range(255):
color = (sx + str(i) + 'm' + 'color ' + str(i+1).ljust(3) + ex)
print(color, sep = ' ', end = ' ', flush = True)

print('\n\nDONE')

0 comments on commit 437969a

Please sign in to comment.