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

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

pytomutil_elunico-0.0.5.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

pytomutil_elunico-0.0.5-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytomutil_elunico-0.0.5.tar.gz
Algorithm Hash digest
SHA256 129b60bb31a5034ce979b6a09c1cd2b5a876673125338930cc84456adb5fde8e
MD5 7465c2fcdd9fba9e687e972b38516ea6
BLAKE2b-256 948c202306cd3cd8642e2abf9b68efc07d0bdbd59ddd1ebea4d13407871e1997

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytomutil_elunico-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1b9eeb1a40c0f84512d34aed68bb9cfe5ef2a6fb38a07c4322ba71c08af288
MD5 0a370b7dafdb4d5c9e20a66f3b2197aa
BLAKE2b-256 d5bf1c46236bb957251e9e280ee6cbff6260c6234c5df7c97004f9309869395a

See more details on using hashes here.

Supported by

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