Simple package for rendering image plate a color scheme palette of neovim or anything else
Project description
Simple wrapper around matplotlib for render color scheme palette
The format of pictures for saving is the same as matplotlib
[!WARNING] The library is under deep development. But it will be very useful to get feedback.
Usage
Install package
pip install draw_palette
Copy the lua file of a defined color.
Example usage:
from draw_palette import utils, DrawPalette
# Use internal lua import function as dict of tuple (color_name, hex)
colors = utils.import_palette("./colors.lua")
# Sort colors by name
colors.sort(key=lambda x: x[0])
# Create palette object
palette = DrawPalette(colors)
# Render it
palette.render()
# Save to the file
palette.save_image(image_name='palette.png')
colors.lua
To render a palette, a color table must be fed to the input.
Example of lua file with scheme:
local M = {}
---@class Palette
---@type table
M.palette = {
red = "#cc6666",
-- color name = "# HEX RGB value",
}
return M.palette
Development
Make Python virtual envelope and enable it
python -m venv .venv
make init
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file draw_palette-0.3.tar.gz.
File metadata
- Download URL: draw_palette-0.3.tar.gz
- Upload date:
- Size: 447.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
665f2ea44e8babd2587511d0f29727599ad2742462abe9f39b54dc1425d36d99
|
|
| MD5 |
aef9c8bf654d43deeadc3ad4efbc50d2
|
|
| BLAKE2b-256 |
c7161058d4dabd3f9584b45d8f05a1211f71534ed90bd47952c0f8f7a4dcbd67
|
File details
Details for the file draw_palette-0.3-py3-none-any.whl.
File metadata
- Download URL: draw_palette-0.3-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07a6069417822fd699d43a4c66a0cacc431211d1ecd67d29d182780c971f9b54
|
|
| MD5 |
87f30c4705c75434924c0d7cc8226288
|
|
| BLAKE2b-256 |
ac625f5acef69a9b3a7a912b81717603acd8ca1424abbbc454fdc3eb8b6ac31f
|