Skip to main content

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.

Sample palette

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

This version

0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

draw_palette-0.3.tar.gz (447.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

draw_palette-0.3-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for draw_palette-0.3.tar.gz
Algorithm Hash digest
SHA256 665f2ea44e8babd2587511d0f29727599ad2742462abe9f39b54dc1425d36d99
MD5 aef9c8bf654d43deeadc3ad4efbc50d2
BLAKE2b-256 c7161058d4dabd3f9584b45d8f05a1211f71534ed90bd47952c0f8f7a4dcbd67

See more details on using hashes here.

File details

Details for the file draw_palette-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for draw_palette-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 07a6069417822fd699d43a4c66a0cacc431211d1ecd67d29d182780c971f9b54
MD5 87f30c4705c75434924c0d7cc8226288
BLAKE2b-256 ac625f5acef69a9b3a7a912b81717603acd8ca1424abbbc454fdc3eb8b6ac31f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page