Skip to main content

A library that make your output colorful in python

Project description

Random Color library

CodeQL

https://user-images.githubusercontent.com/79264026/172701097-337571d8-23fd-45a1-8cdc-72b97acc0176.mp4

This Python library makes your terminal output colorful ✨
On this Python library, you can access 255 kinds of color randomly!
There are just 15 colors for windows(cmd) users 😥

YouTube Tutorial 📹

installation

for installation, first make sure that you're in RandomColorlib folder, which setup.py exists,
then enter this command in your terminal:

pip install .

features


Usage

importing

For importing the library You can use the following:

# First way 
import RandomColor
RandomColor.Rcolor.<Module Name>

# Easier way
from RandomColor import Rcolor

# For importing all modules:
from RandomColor.Rcolor import * 

Important tip

cmd can't support all colors so it's better to use :

from RandomColor import Rcolor

print(Rcolor.windows_color("Hello, World")) # random color
print(Rcolor.windows_background("Hello, World")) # random background
  • You can use the Auto part too, Which doesn't depend on the operating system and automatically detects the operating system
from RandomColor import Rcolor

print(Rcolor.auto_color("Hello, World")) # Automatic random color
print(Rcolor.auto_background("Hello, World")) # Automatic random background

Changing font color

Make Sure to check Important tip

from RandomColor import Rcolor

print(Rcolor.color('Hello, World!'))
print(Rcolor.windows_color("Hello, World")) 

Changing Background color

Make Sure to check Important tip

from RandomColor import Rcolor

print(Rcolor.background('Hello, World'))
print(Rcolor.windows_background('Hello, World')) 

Changing font (style)

Make Sure to check Important tip

from RandomColor import Rcolor
Rcolor.style('Hello, World!')

Multiple capabilities

from RandomColor import Rcolor

# Change front color with background color at the same time
Rcolor.color_background("Hello world")

# Change the front color with the font at the same time
Rcolor.color_style("Hello world")

# Change background with font at the same time
Rcolor.background_style("Hello world")

# Change front color with background color and font at the same time
Rcolor.color_background_style("Hello world") 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Rcolor-2.0.0.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

Rcolor-2.0.0-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page