Skip to content

Instantly share code, notes, and snippets.

View JeffreyPalmer's full-sized avatar

Jeffrey Palmer JeffreyPalmer

View GitHub Profile
@mattdesl
mattdesl / palette-btoa.js
Last active December 14, 2023 21:49
palette compression
// Polyfill so we can run this in Node.js as well
if (typeof atob !== 'function') {
var atob = a => Buffer.from(a, 'base64').toString('binary')
var btoa = b => Buffer.from(b).toString('base64');
}
// 511 bytes after minify
var a=[
["#1b6f3f", "#10c5b4", "#ade4cd", "#29ec19"],
["#96bde8", "#246a85", "#3483e4", "#b168f6"],
<!--
Go to Line 153 for the start of Uniform Buffer Object related code and intro
Prerequsite:
You at least know what uniforms are in the context of WebGL
and mininally understand the concepts involved in creating a square in WebGL
-->
<html>