Skip to main content

Python module for beautifully varying RGB colour sets which can be used for setting colours anywhere!

Project description

PyBeauty

Python module for beautifully varying RGB colour sets which can be used for setting colours anywhere! This module basically varies RGB values in various random ranges via threading.Timer() executing continously after very small interval of time i.e. in milliseconds hence resulting in beautiful transition of colours.

Installation

Simply using PyPi:

pip install pybeauty

Usage

Simply use this code (Modify according to your needs):

from pybeauty import Beauty

def on_new_color(rgb_color):
    r_value = rgb_color[0]
    g_value = rgb_color[1]
    b_value = rgb_color[2]
    #Now you can do anything with the RGB values (set as background, set as text colour, etc..).

Beauty(Parameters, on_new_color) #Parameters is a dictionary for optional parameters (More about them specified below).

Optional Parameters that are available are listed below in Parameters section and have to be passed as a Dictionary (keys as name of parameters listed in Parameters section and value is your desired choice according to the options available for that parameter as specified in the Parameters section) which will be the first parameter for Beauty() constructor.

Parameters

  • mode (Optional)

    Specifies colour set in which the colours have to vary.

    • Parameter Value Type: str or list.

    • Options for mode parameter

      • "dark": Varies the colour in dark colours only (useful for dark mode projects).
      • "light": Varies the colour in light colours only (useful for light mode projects).
      • [start_rgb, end_rgb]: Varies the colour from start_rgb value (can be from 0 to 255) to end_rgb value (can be from 0 to 255).
    • Default Value: "" (i.e. varies from 0 to 255 RGB Values).

  • start (Optional):

    Specefies colour in RGB format from which colours have to start varying.

    • Input type for start parameter: list [R_Value, G_Value, B_Value] (eg. [0, 0, 0] for black).

    • Default Value: [0, 0, 0] (for "dark", none or other mode parameter specified) and [255, 255, 255] (for "light" mode parameter specified).

  • time (Optional):

    Specifies the time in milliseconds after which the colour is changed according to its range. Useful for decreasing the time when using on slow hardware for maintaining the smoothness.

    • Parameter Value Type: int.

    • Default Value: 40 ms (Just perfect for majority hardware types).

So go ahead and enjoy the beauty of time varying RGB colour sets!

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

pybeauty-1.0.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file pybeauty-1.0.tar.gz.

File metadata

  • Download URL: pybeauty-1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/2.7.15rc1

File hashes

Hashes for pybeauty-1.0.tar.gz
Algorithm Hash digest
SHA256 b14a42292c6fc7f5f572c0ffa8888ef6ffa079ae0076709b70c3f71672d12384
MD5 f5cbb83f46251a64c13a849255391d6a
BLAKE2b-256 6a732a6fdcfb4705fac8dd740403ac41af5c3ed6593891184f772457a6e86815

See more details on using hashes here.

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