// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Build RGB from HSL design values // Not compiled or tested in-world // Setup: Use a spare owned prim. Set HUE degrees and SATURATION/LIGHTNESS0..1. Touch for owner-only numeric output. // Stop / restore: Remove/disable; no colors or materials are applied. // Notes: HSL lightness is a geometric channel measure, not perceptual luminance. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Color calculation only. float HUE=220.0; float SATURATION=0.6; float LIGHTNESS=0.4; float channel(float p,float q,float t) { if(t<0.0)t+=1.0; if(t>1.0)t-=1.0; if(t<1.0/6.0)return p+(q-p)*6.0*t; if(t<0.5)return q; if(t<2.0/3.0)return p+(q-p)*(2.0/3.0-t)*6.0; return p; } default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(SATURATION<0.0||SATURATION>1.0||LIGHTNESS<0.0||LIGHTNESS>1.0) { llOwnerSay("Saturation/lightness must be0..1."); return; } float h=HUE/360.0; h-=llFloor(h); float q=LIGHTNESS*(1.0+SATURATION); if(LIGHTNESS>=0.5)q=LIGHTNESS+SATURATION-LIGHTNESS*SATURATION; float p=2.0*LIGHTNESS-q; llOwnerSay("RGB="+(string)); } }