Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abdullah-1312007/colors-python
ColorsPy makes it easy to access colors and use them in various programs like PyGame.
https://github.com/abdullah-1312007/colors-python
color-conversion colors colorspy hex library module package pycolor pycolors pygame python python2 python3 rgb
Last synced: 2 days ago
JSON representation
ColorsPy makes it easy to access colors and use them in various programs like PyGame.
- Host: GitHub
- URL: https://github.com/abdullah-1312007/colors-python
- Owner: abdullah-1312007
- License: mit
- Created: 2021-01-19T05:35:36.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-27T05:59:51.000Z (almost 4 years ago)
- Last Synced: 2024-10-13T09:41:27.243Z (about 1 month ago)
- Topics: color-conversion, colors, colorspy, hex, library, module, package, pycolor, pycolors, pygame, python, python2, python3, rgb
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
``` py
from colorspy import *print(red)
print(blue)
```- For PyGame:
``` py
import colorspy as colors
import pygamepygame.init()
win = pygame.display.set_mode((800, 600))
run = Truewhile run:
"""
Rest of your code
"""win.fill(colors.red)
pygame.display.update
```- Color Conversion:
``` py
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
``` py
import colorspy as colorsmy_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 bugv 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