Skip to main content

Random Color library

CodeQL

https://github.com/ibehii/RandomColorlib/assets/79264026/0daa3c30-3f45-4abc-8343-0d6ce11ee20b

This Python library makes your terminal output colorful ✨
On this Python library, you can access 255 kinds of color randomly!

YouTube Tutorial 📹

installation

For installation, enter this command in your terminal:

pip install Rcolor==3.0.1

features


Usage

importing

For importing the library You can use the following:

# First way 
import Rcolor
Rcolor.<Module Name>

# Easier way
from Rcolor import <Module Name>

# For importing all modules (Not recommended):
from Rcolor import * 

Important tip

Some terminals like cmd can't support all colors so it's better to use standard colors:

import Rcolor

print(Rcolor.standard_fg("Hello, World")) # random foreground color
print(Rcolor.standard_bg("Hello, World")) # random background color
print(Rcolor.standard_rainbow_fg("Hello world")) # to change foreground for each character using standard colors
  • You can use the Auto part too, Which doesn't depend on the operating system and automatically detects the operating system
import Rcolor

print(Rcolor.auto_fg("Hello, World")) # Automatic random foreground color
print(Rcolor.auto_bg("Hello, World")) # Automatic random background color

Changing the foreground color

Make Sure to check Important tip

import Rcolor

print(Rcolor.foreground('Hello, World!'))  # to use 255 colors
print(Rcolor.standard_fg("Hello, World"))  # to use standard color (15 colors).

Changing the Background color

Make Sure to check Important tip

import Rcolor

print(Rcolor.background('Hello, World')) # to use 255 colors
print(Rcolor.standard_bg('Hello, World')) # to use standard color (15 colors).

Changing the font (style)

Make Sure to check Important tip

import Rcolor
print(Rcolor.style('Hello, World!'))

Change the foreground color for each character

Make Sure to check Important tip

import Rcolor
print(Rcolor.rainbow_fg("Hello world"))
print(Rcolor.standard_rainbow_fg("Hello world"))

Multiple capabilities

import Rcolor

# Changes the foreground color and background color at the same time
Rcolor.foreground_background("Hello world")

# Changes the the foreground color and the font at the same time
Rcolor.foreground_style("Hello world")

# Changes the background color and font at the same time
Rcolor.background_style("Hello world")

# Changes foreground color, background color and font at the same time
Rcolor.foreground_background_style("Hello world") 

Metadata

Release files for Rcolor 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Rcolor 3.0.1
File Size Uploaded
rcolor-3.0.1.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Rcolor 3.0.1
File Interpreter ABI Platform
Rcolor-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.3 kB

Release files / rcolor-3.0.1.tar.gz

Download URL rcolor-3.0.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8d1f28b602c5e978a2907007ae183d8e1163085787c3d42a8a03c0cf6a2bfccf
BLAKE2b-256 checksum
How to use checksums
d52bd58ab537336bb7daaf1e796dd687df719570bbf7d29b1c2639f1c9c7ff54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / Rcolor-3.0.1-py3-none-any.whl

Download URL Rcolor-3.0.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2003e68354060936acf8502bbb4f4cbedfbb8c3090230b18efe09d1264871d2
BLAKE2b-256 checksum
How to use checksums
d09b0419c23f9ae69896fe816a10258673459cd32cdd217cc10952ec38ab34f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

3.0.0

2 release files

2.0.3

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page