palette.ex

new topic     » topic index » view thread      » older message » newer message

I've written a program for myself to display the RGB values and a screen of
the color in mode 261.  I feel obligated to share this with the list, since
this is what I believe to be a valuable tool.

--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]
    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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu