Skip to main content

All main RGB color values for easy access

Project description

ColorsPy

This is a simple python package that can be used for adding colors in PyGame or just to see the RGB values of almost any color.

Example Code:

  • Basic use:
    from colorspy import *

    print(red)
    print(blue)
  • For PyGame:
    import colorspy as colors
    import pygame

    pygame.init()

    win = pygame.display.set_mode((800, 600))
    run = True

    while run:
	"""
   	Rest of your code
	"""

    	win.fill(colors.red)

    	pygame.display.update
  • Color Conversion:
    from colorspy import *

    converter = ColorConverter()

    """
    If you want any other color's HEX value, you could just pass a tuple of the RGB values.
    The hash variable is a boolean that tells that if you want a hash sign in the HEX value.
    """

    hex_red = converter.rgb2hex(red, hash=True) 

    """
    This will return the RGB value of blue.
    """

    rgb_blue = converter.hex2rgb("0000ff") 
  • Color Picker
import colorspy as colors

my_color = colors.color_picker()

"""
This will return a list of the RGB value and the HEX value of the color you select. There is also a argument hex_value which is a boolean. You can use that to decide that whether you want the HEX value or not.
"""

v 0.1

  • Added most basic colors.

v 0.2

  • Added support for RGB to HEX and HEX to RGB color conversion.
  • Added a few more colors.

v 0.2.1

  • Fixed a minor bug

v 0.3

  • Added a whole lot more colors.
  • Added a color picker to choose colors easily.

v 0.4

  • Fixed color values of some colors

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

colorspy-0.4.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file colorspy-0.4.tar.gz.

File metadata

  • Download URL: colorspy-0.4.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

File hashes

Hashes for colorspy-0.4.tar.gz
Algorithm Hash digest
SHA256 51f6b2e03268c15aadbdbcf1c986cc7387c2c82f81f2c4a611613422f29638fe
MD5 9579d9cc2ed3def36d488164f509a66b
BLAKE2b-256 f5f9915895b4d7f7f0c915556672b8f0aa87052bd4f94038b0d2a40f7a9dd60f

See more details on using hashes here.

Supported by

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