Skip to content

Instantly share code, notes, and snippets.

View FranLMSP's full-sized avatar
🦀

Franco FranLMSP

🦀
View GitHub Profile
@yuriuliam
yuriuliam / colors.ts
Last active March 4, 2024 06:15
A way to convert colors from one format to another by using Math Algorithms
import { isNumber, isBetween } from './numbers'
type ARGB32 = number
/**
* Represents a red-green-blue key-value object.
* all values are limited from 0 to 255 when used internally.
*/
type RGB = { red: number; green: number; blue: number }
type RGBA = RGB & { alpha: number }
type RGBA32 = number