// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Convert to and from premultiplied alpha // Not compiled or tested in-world // Setup: Use a spare owned prim. Set RGB and ALPHA0..1. Touch for owner-only numeric output. // Stop / restore: Remove/disable; no colors or materials are applied. // Notes: Zero alpha contains no recoverable RGB in premultiplied form. This is a data representation tool, not a viewer alpha-mode setter. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Color calculation only. vector RGB=<0.8,0.3,0.1>; float ALPHA=0.4; default { touch_start(integer detectedCount) { if(llDetectedKey(0)!=llGetOwner())return; if(ALPHA<0.0||ALPHA>1.0) { llOwnerSay("Alpha must be0..1."); return; } vector premultiplied=RGB*ALPHA; llOwnerSay("Premultiplied="+(string)premultiplied); if(ALPHA>0.000001)llOwnerSay("Recovered="+(string)(premultiplied/ALPHA)); else llOwnerSay("Zero alpha: source RGB is unrecoverable."); } }