// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Momentary color scrubber // Not compiled or tested in-world // Setup: Set FACE to a flat face on a spare prim. Owner-touch and drag across that face. Edit LEFT and RIGHT to choose endpoints. // Stop / restore: Release the touch and wait two seconds before removing. The watchdog also restores color if touch-end is missed. // Notes: Preview lasts only during interaction. UV texture transforms do not affect the ST coordinate used for blending. // License: see LICENSE in this distribution. // Original Incoprea example. MIT. Not compiled or tested in-world. integer FACE = 0; vector LEFT = <0.1, 0.3, 1.0>; vector RIGHT = <1.0, 0.5, 0.1>; vector original; preview() { if (llDetectedKey(0) != llGetOwner() || llDetectedTouchFace(0) != FACE) return; vector st = llDetectedTouchST(0); if (st.x < 0.0 || st.x > 1.0) return; llSetColor(LEFT * (1.0 - st.x) + RIGHT * st.x, FACE); llSetTimerEvent(2.0); } restore() { llSetColor(original, FACE); llSetTimerEvent(0.0); } default { state_entry() { original = llGetColor(FACE); } touch_start(integer count) { preview(); } touch(integer count) { preview(); } touch_end(integer count) { if (llDetectedKey(0) == llGetOwner()) restore(); } timer() { restore(); } }