1. arr: BUG IN PALETTE.EX
- Posted by Alan Tu <ATU5713 at COMPUSERVE.COM>
Dec 20, 1998
-
Last edited Dec 21, 1998
There is a critical bug in palette.ex. You will get a subscript error in
some cases, and all other colors should be off by 1.
--begin palette3.ex
include graphics.e
include get.e
include image.e
integer g, key
sequence s
object color
g = graphics_mode(261)
s = get_all_palette()
g = graphics_mode(-1)
while 1 do
clear_screen()
puts(1,"Enter color #: ")
color = gets(0)
if length(color) = 1 then
abort(0)
end if
color = color[1..length(color)-1]
color = value(color)
color = color[2]
puts(1,"\nRGB: ")
? s[color+1] -- the +1 wasn't here before
key = wait_key()
g = graphics_mode(261)
clear_screen()
polygon(color, 1, {{0, 0}, {0, 767}, {1023, 767}, {1023, 0}})
key = wait_key()
g = graphics_mode(-1)
end while
--end palette3.ex