@mesmotronic/three-retropass
Version:
RetroPass applies a retro aesthetic to your Three.js project, emulating the visual style of classic 8-bit and 16-bit games
8 lines (7 loc) • 350 B
JavaScript
import * as THREE from 'three';
const MIN_COLOR_COUNT = 2;
const MAX_COLOR_COUNT = 4096;
export const validColorCounts = Array.from({ length: MAX_COLOR_COUNT - MIN_COLOR_COUNT + 1 }).map((_, i) => i + 2);
export function isValidColorCount(colorCount) {
return colorCount === THREE.MathUtils.clamp(colorCount, MIN_COLOR_COUNT, MAX_COLOR_COUNT);
}