Skip to content

Instantly share code, notes, and snippets.

View deepakxyz's full-sized avatar
🎯
Focusing

Deepak Rajan deepakxyz

🎯
Focusing
View GitHub Profile
@laundmo
laundmo / lerp.py
Last active May 12, 2024 11:48
lerp, inverse lerp and remap in python
def lerp(a: float, b: float, t: float) -> float:
"""Linear interpolate on the scale given by a to b, using t as the point on that scale.
Examples
--------
50 == lerp(0, 100, 0.5)
4.2 == lerp(1, 5, 0.8)
"""
return (1 - t) * a + t * b
@MrLixm
MrLixm / blackbody_to_rgb.py
Created February 3, 2021 13:52
Convert Kelvin Temperatures to RGB values with given colorspace primaries.
"""
Convert Kelvin Temperatures to RGB values with given colorspace primaries.
Author: Liam Collod
Last Modified: 02/02/2021
Require colour-science >= 0.3.16
"""
import colour