Awesome! thanks… will add immediately to my UX design toolbox… Svasti Astu, Be Well Brahmanathaswami
www.himalayanacademy.com On 10/6/16, 9:21 AM, "use-livecode on behalf of J. Landman Gay" <use-livecode-boun...@lists.runrev.com on behalf of jac...@hyperactivesw.com> wrote: Does this work well enough?: function luminanceRatio c1,c2 -- pass two RGB triplets put calcLuminance(c1) into tL1 put calcLuminance(c2) into tL2 return max(tL1,tL2) / min(tL1,tL2) end luminanceRatio function calcLuminance pRGB -- wikipedia: Y = 0.2126 R + 0.7152 G + 0.0722 B put item 1 of pRGB * 0.2126 into tR put item 2 of pRGB * 0.7152 into tG put item 3 of pRGB * 0.0722 into tB return sum(tR,tG,tB) # if sum(tR,tG,tB) > 125 then return "black" # else return "white" end calcLuminance _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode