Re: Win32Lib: Flood Fill Demo
- Posted by Brian Broker <bkb at CNW.COM> Oct 02, 2000
- 402 views
On Mon, 2 Oct 2000 21:20:43 +1100, Derek Parnell wrote: >Hi Brian, > >----- Original Message ----- >From: "Brian Broker" <bkb at CNW.COM> >To: <EUPHORIA at LISTSERV.MUOHIO.EDU> >Sent: Monday, October 02, 2000 1:15 PM >Subject: Re: Win32Lib: Flood Fill Demo > ><snip> >> the Win32Lib constant definitions for Red, Green, and >> Blue are off by one and should use a value of 128 instead of 127... (and >> other color constants should be tweaked accordingly). > >Why do you think that 128 should be used instead of 127? > >You may very well be correct. I can't find any definitive documentation on >this. The red scale has 256 different shades (0 - 255), so halfway is 127.5, >which means that we have to pick an integer near that. So why 128 and not >127? Aren't they equally as good as each other? Because, if I run my flood fill demo in 16-bit color, I get dithered remnants of the previous color, meaning that (127,0,0), (0,127,0), etc. are not 'pure' colors. If they were defined with 128 instead of 127, there would be no dithering in 16-bit color (they would be pure colors) and my demo would work 'properly' (i.e. there would be no dithered remnants left over). Follow? >It seems that Microsoft defines RED as (255,0,0). David decided to differentiate between bright red and plain red, which is fine by me [ BrightRed = (255,0,0) ] -- Brian