Skip to content

Instantly share code, notes, and snippets.

View adamstddrd's full-sized avatar

Adam Stoddard adamstddrd

View GitHub Profile
@adamstddrd
adamstddrd / theme-picker.js
Created September 18, 2023 22:54
A theme picker custom element with a "random" option
/* ----------------------------------------------------------------------------
switch between color themes
---------------------------------------------------------------------------- */
export default class ThemePicker extends HTMLElement {
static randomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
static getLuminanace(values) {
const rgb = values.map((v) => {