// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Harmonious face palette // Not compiled or tested in-world // Setup: Use a spare multi-face prim. Owner-touch creates a palette; the next touch restores. White or neutral textures show the palette most clearly. // Stop / restore: Touch to restore before removing or resetting. The original face tints are kept only in script memory. // Notes: Faces receive different hue offsets with fixed saturation and brightness. This does not alter alpha or PBR material settings. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. list original; integer preview; vector hue(float h) { float sector = h * 6.0; integer part = (integer)sector; float f = sector - part; float low = 0.35; float rising = low + (1.0 - low) * f; float falling = 1.0 - (1.0 - low) * f; if (part == 0) return <1.0, rising, low>; if (part == 1) return ; if (part == 2) return ; if (part == 3) return ; if (part == 4) return ; return <1.0, low, falling>; } default { state_entry() { integer face; for (face = 0; face < llGetNumberOfSides(); ++face) original += [llGetColor(face)]; } touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; preview = !preview; integer total = llGetListLength(original); integer face; float base = llFrand(1.0); for (face = 0; face < total; ++face) { if (!preview) llSetColor(llList2Vector(original, face), face); else { float h = base + (float)face / (float)total; if (h >= 1.0) h -= 1.0; llSetColor(hue(h), face); } } } }