1. palette.ex

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 message » categorize

2. Re: palette.ex

Alan Tu wrote:

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

 Excellent, I was just about to write a similar program myself, but thanks for
saving my the trouble =)

Hope you don't mind if I use this for something I'm working on.

Thanks again,
Greg

--
Greg Phillips
i.shoot at rednecks.com
http://euphoria.server101.com
--

Useless fact of the day:

The most worldwide spoken language is Mandarin Chinese

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu