Git Product home page Git Product logo

catcolor's Introduction

CatColor

Color Class Usage

This documentation outlines how to use the Color class to generate and manipulate colors.

Initialization

To start using the Color class, initialize it by specifying the desired number of colors to generate. The constructor accepts two parameters:

  1. Number of Colors: The first parameter dictates how many colors you want to generate.
  2. Random Seed: The second parameter is the random seed. Providing a seed ensures that the color generation is repeatable. If a seed is not provided, one will be automatically generated, and it can be retrieved after the code execution for repeatability purposes.

Example:

c = Color(3, 17)

Generating Random Colors

To generate random colors and retrieve the used or generated random seed, use the random_select_color method. This method returns a tuple containing the randomly selected colors and the random seed.

Example:

random_color, random_seed = c.random_select_color()
print(random_color, random_seed)

Finding Bright or Dark Colors

The gradient_color method allows you to find either bright or dark colors based on a level you specify. Levels range from 1 to 5, where 1 corresponds to the brightest and 5 to the darkest.

Example:

level_color = c.gradient_color(1)

Retrieving All Generated Colors

You can retrieve all generated colors using the get_all_color method. This method returns a list of all colors currently managed by the Color class instance.

Example:

all_color = c.get_all_color()

Displaying Colors

To display the colors, use the show_color method. Pass the list of colors you wish to display to this method.

Example:

print(c.show_color(all_color))

catcolor's People

Contributors

lfelixc avatar

Stargazers

 avatar longkuku 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.