Howdy-Tzi wrote:
> 
> On Wednesday, Jun 4, 2003, at 08:53 America/Chicago, Rodrigo Peres
> wrote:
> 
> > There's a way to compare if colors are
> > greater than or darker than???
> 
> Try using color objects and palette index conversions:
> 
> oColor = color(#rgb, 255,255,255)
> oColor2 = color(#rgb, 0,0,0)
> put oColor.paletteIndex > oColor2.paletteIndex
> -- 0
> put oColor.paletteIndex < oColor2.paletteIndex
> -- 1

Works in the extreme case, but it gets shaky in the middle values unless you're using 
the greyscale palette:

cyan = color(#rgb, 0, 255, 255)
dkcyan = color(#rgb, 0, 204, 255)
dkbrn = color(#rgb, 51, 0, 0)

-- System - Win palette
put cyan.paletteIndex 
-- 1
put dkbrn.paletteIndex
-- 179
put dkcyan.paletteIndex
-- 184

-- System - Mac palette
put cyan.paletteIndex 
-- 180
put dkbrn.paletteIndex
-- 179
put dkcyan.paletteIndex
-- 186


-- Greyscale palette
put cyan.paletteIndex 
-- 85
put dkbrn.paletteIndex
-- 238
put dkcyan.paletteIndex
-- 102

-- 
Carl West   [EMAIL PROTECTED]   http://eisen.home.attbi.com

I have no superfluous leisure; my stay must be stolen out
of other affairs; but I will attend you awhile.
           - Isabella, Measure for Measure, Act 3 Scene 1
-
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to