Library for parsing and writing Simple Property List (SPL) files
Project description
PyTomUtil
A collection of helpful utilties in Python.
Similar to the tecoradors-elunico
package I have but that is just for useful decorators. This is any useful utility: function or class or other
PyPI
Not yet published to PyPI but coming soon.
Content
frange
class works like range
but allows floating point values. Requires start
, stop
, and step
to always be specified
class frange:
def __init__(self, start: float, stop: float, step: float) -> None:
...
def __iter__(self):
...
def __next__(self):
...
lerp
is a function for linearly interpolating between two values according to a percentage between 0.0 and 1.0.
Linear Interpolation in Wikipedia
def lerp(a: float, b: float, t: float) -> float:
return (1 - t) * a + t * b
SRGBColor
is a class for managing colors in SRGB color space. Works with linear interpolation between colors and luminance
values. The class accepts r, g, b and optionally an alpha channel in the range 0.0 to 1.0.
class SRGBColor:
def __init__(self, r: float, g: float, b: float, a: float = 1.0):
...
def lerp(self, other: "SRGBColor", percent: float) -> "SRGBColor":
...
@property
def luminance(self) -> float:
"""Given an sRGB color as 3 RGB values between 0 and 1, return their relative luminance"""
...
Project details
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
File details
Details for the file pytomutil_elunico-0.0.1.tar.gz
.
File metadata
- Download URL: pytomutil_elunico-0.0.1.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e785e77072bc9a5cefbd52a86721f792595e47095137a106847822e2b538d49d |
|
MD5 | c64bd96c72a0d1e6c446f8c380ba561e |
|
BLAKE2b-256 | 70b37985fed852e75b7c1f0d2cabccbdf9f0a90c6e66b72098d3d9b2cc65d2eb |
File details
Details for the file pytomutil_elunico-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pytomutil_elunico-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8ae5f0f255c264643da5c92e76636b9430c45c2bd5dd0c0a04e61542d7aeac9 |
|
MD5 | 64bf8d4268b389487e4f865064b08409 |
|
BLAKE2b-256 | 64fc33908d58dd17a012e533abe7f49a8fb2720ece12bef1729596b58328d110 |