Giter Club home page Giter Club logo

randomcolorlib's Introduction

Random Color library

CodeQL

RandomColorlib.mp4

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.0

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") 

randomcolorlib's People

Contributors

ibehii avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.