Color scheme manager package for your projects
Project description
csmpy
The csmpy python package (color scheme manager) for your projects enabling customization and management of color schemes.
Installation
Install the package:
With pip or pip3
pip install csmpy
Add it to your requirements.txt
file:
csmpy>=<version>
Now you can install it by running:
pip install -r requirements.txt
Usage
Feel free to customize the variable name according to your preference!
Without YAML file
from csmpy import ColorSchemeManager
# Define values (required)
DEFAULT_COLORS = {
'logo': 'red',
'text': 'blue',
'result': 'light_white',
}
# Load all colors
all_colors = ColorSchemeManager.load_colors(DEFAULT_COLORS)
# Example usage
logo_color = all_colors['logo']
text_color = all_colors['text']
result_color = all_colors['result']
print(f"This is a {logo_color} example of {text_color} using {result_color} colors.")
With a YAML file
from csmpy import ColorSchemeManager
# Define values (required)
DEFAULT_COLORS = {
'logo': 'red',
'text': 'blue',
'result': 'light_white',
}
# Load custom colors from a YAML file
custom_colors = ColorSchemeManager.load_custom_yaml_file('examples/custom_settings.yaml')
# Merge default and custom colors
all_colors = ColorSchemeManager.load_colors(DEFAULT_COLORS, custom_colors)
# Example usage
logo_color = all_colors['logo']
text_color = all_colors['text']
result_color = all_colors['result']
print(f"This is a {logo_color} example of {text_color} using {result_color} colors.")
Both of these examples can be found in the examples
folder.
License
The source code is released under the MIT License.
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
csmpy-0.2.tar.gz
(3.3 kB
view hashes)
Built Distribution
csmpy-0.2-py3-none-any.whl
(3.9 kB
view hashes)