A simple Pygame module for accessing predefined colors that will ease your scripting and save the time
Project description
pygame_colors
pygame_colors
is a simple Python module for Pygame that provides pre-defined color names and utility functions to make Pygame scripts easier to read and write.
Author: Basit Ahmad Ganie
email : basitahmed1412@gmail.com
Installation
You can install the package via pip:
pip install pygame_colors
Example usage:
```python
import pygame from pygame_colors import get_color, lighten, darken
Initialize Pygame
pygame.init()
Set up screen
screen = pygame.display.set_mode((400, 300))
Main loop
running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False
# Set background color using 'skyblue'
screen.fill(get_color('skyblue'))
# Draw a rectangle with a lighter version of 'firebrick'
pygame.draw.rect(screen, lighten(get_color('firebrick')), (50, 50, 100, 50))
pygame.display.flip()
pygame.quit()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pygame_colors-1.0.0.tar.gz
.
File metadata
- Download URL: pygame_colors-1.0.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02c790e2aa9c3c9a6c01ecce279ceb3c2b521edc95ce341f20708f42d83617bc |
|
MD5 | bb2a8bf8ddaead34a92548b995c400da |
|
BLAKE2b-256 | 6e7003c965b7d384624cd2d42b07b8536da35df5073f41da462f19118bbb4150 |
File details
Details for the file pygame_colors-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pygame_colors-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4c03680178cc53cab9edf486c62e7469136a6f13576e9e4b712ef2b11d86573 |
|
MD5 | e54f3a93c60b4fe4e5bb3ecd8803b92a |
|
BLAKE2b-256 | e19a6bd575ff88eb4f729505066c84bf493eb668aa5c9f66765a962eac73c128 |