Skip to content

Instantly share code, notes, and snippets.

--!strict
-- jonbyte, 2025
-- types
type Int = number
type i53 = Int
type Type = Int
type Index = Int
type Map<K, V> = { [K]: V }
type Array<V> = Map<Int, V>
-- jonbyte, 2024
-- approximate a kelvin temperature as RGB
-- the result of messing around with equations and seeing the results
local R, G, B = 560, 530, 420 -- sample wavelengths
local c = 299792458 -- speed of light (m/s)
local h = 6.62607015e-34 -- planck constant
local k = 1.380649e-23 -- boltzmann constant
local vec0 = vector.create(0, 0, 0)