🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

ChromifyPro

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ChromifyPro

Color conversion library

pipPyPI
Version
1.0.1
Maintainers
1

ChromifyPro

PyPI Python Version License

ChromifyPro is a Python library for working with color palettes and themes.
It comes with built-in templates and also allows loading custom palettes from ZIP files.

Features

  • Preloaded color templates accessible via a global dictionary.
  • Load custom palettes from ZIP files containing JSON, CSV, or TXT color files.
  • Supports hex color strings (#RRGGBB or #RGB).
  • Password-protected ZIP files are supported (default password: "ChromifyPro").

Installation

pip install ChromifyPro

Usage

1. Using Built-in Templates

ChromifyPro automatically loads templates from the ChromifyPro_template folder when imported. Use the global TEMPLATE_COLORS dictionary to access them.

from ChromifyPro import TEMPLATE_COLORS

# List available palettes
print("Available palettes:", list(TEMPLATE_COLORS.keys()))

# Access colors from a specific palette
palette_name = "palette_01"
colors = TEMPLATE_COLORS.get(palette_name, [])
print(f"Colors in {palette_name}: {colors}")

Example structure of TEMPLATE_COLORS:

{
  "palette_01": ["#FF0000", "#00FF00", "#0000FF"],
  "palette_02": ["#123456", "#ABCDEF"],
}

2. Loading Custom Templates from a ZIP File

The load_from_zip function allows loading custom palettes from a ZIP file:

  • JSON: [{"hex": "#FF0000"}, {"hex": "#00FF00"}]
  • CSV: name,hex
  • TXT: each line is a hex color like #RRGGBB
from ChromifyPro import load_from_zip

# Load colors directly from a ZIP file
colors = load_from_zip("/path/to/custom_palettes.zip")

# Print loaded colors
for color in colors:
    print(color.to_hex())

Returns a list of Color objects ready to use.

3. Updating TEMPLATE_COLORS with Custom ZIP

After loading a ZIP, refresh the global TEMPLATE_COLORS to include new palettes:

from ChromifyPro import load_from_template, TEMPLATE_COLORS

# Reload templates into the global TEMPLATE_COLORS dictionary
TEMPLATE_COLORS = load_from_template()

# Access a newly loaded custom palette
custom_colors = TEMPLATE_COLORS.get("my_custom_palette", [])
print(custom_colors)

Notes

  • Password-protected ZIP files use "ChromifyPro" as the default password.
  • Supported file types inside the ZIP: JSON, CSV, TXT.
  • Hex colors must follow the standard format: #RRGGBB or #RGB.

License

This project is licensed under the MIT License.

Example Directory Structure

ChromifyPro/
├── __init__.py
├── Color.py
├── Converter.py
├── utils.py
├── ChromifyPro_template/
│   ├── palette_01.json
│   ├── palette_02.csv
│   └── ...
└── ...

References

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts