Skip to main content

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

https://pypi.org/project/pytomutil-elunico/

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

pytomutil_elunico-0.0.11.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

pytomutil_elunico-0.0.11-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file pytomutil_elunico-0.0.11.tar.gz.

File metadata

  • Download URL: pytomutil_elunico-0.0.11.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for pytomutil_elunico-0.0.11.tar.gz
Algorithm Hash digest
SHA256 c83c54d30f7149c8d95fa45536347a8c897a8cfcda68c8aa8ec71ad83f5bfa0c
MD5 efb84017d00b9d3b2be1e66369189379
BLAKE2b-256 14b2729abf5f1f5840f92465a9aa28e5c345e3c65de34c259f1fc5c29d9265b6

See more details on using hashes here.

File details

Details for the file pytomutil_elunico-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for pytomutil_elunico-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 8b0eb78f88abbd083f5e53f6d6db1c450d288727bb811f6a9c1a05533a26620c
MD5 60dab9107966baa5108da1c46635c45f
BLAKE2b-256 ffd6aee82f02713b4872ef93d51363e7e7b3c904a76039da383c5ff917f6fa4f

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