Skip to content

Instantly share code, notes, and snippets.

View NachoToast's full-sized avatar

Liam Douglas NachoToast

View GitHub Profile
@NachoToast
NachoToast / color_gradient.ts
Last active March 3, 2023 09:38
Color gradient function for TypeScript.
/** Valid values are from 0 to 255 (inclusive) */
export interface Colour {
red: number;
blue: number;
green: number;
}
/** Calculates an intermediary colour between 2 or 3 colours.
* @returns {Colour} Object with red, green, and blue number fields.
* @example -> {red: 123, blue: 255, green: 0}