1. std/graphcst.e colors in OSX - cont.

Hey....

> DEREK < made me do it!

I posted an extra-lengthy reply to his last post wanting feedback for $EUDIR and $EUINC etc. - and BOOM everything broke all to hell ;))

Way to go, Derek... ;)

Anyway, I still have the info you wanted, Derek. I hate to paste it into another post here. Should I send it to you privately?

I tried to edit my profile here, as well, to have my email address visible BOOM that broke too! I'm bloody well jinxed. L8r... duke

new topic     » topic index » view message » categorize

2. Re: std/graphcst.e colors in OSX - cont.

dukester said...

Hey....

> DEREK < made me do it!

I posted an extra-lengthy reply to his last post wanting feedback for $EUDIR and $EUINC etc. - and BOOM everything broke all to hell ;))

Way to go, Derek... ;)

Anyway, I still have the info you wanted, Derek. I hate to paste it into another post here. Should I send it to you privately?

I tried to edit my profile here, as well, to have my email address visible BOOM that broke too! I'm bloody well jinxed. L8r... duke

Paste it in http://euphoria.pastey.net and then post the link here.

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

3. Re: std/graphcst.e colors in OSX - cont.

jimcbrown said...
dukester said...

Hey....

> DEREK < made me do it!

[snip]

Paste it in http://euphoria.pastey.net and then post the link here.

http://euphoria.pastey.net/128259-2kdv

I wish that I had been aware of the pastey site before now...

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

4. Re: std/graphcst.e colors in OSX - cont.

Ok, that shows that you are running the correct library file. Now how about the other questions I asked about? You are sure making it hard for anyone to help you blink

There are four other questions I asked.

  1. When you run text_color(3), what is the actual color you are seeing?
  2. When you run text_color(6), what is the actual color you are seeing?
  3. When you run eui -version, what exactly is being displayed?
  4. When you run the program below, what exactly is being displayed?
---- 
ifdef OSX then 
puts(1, "OSX") 
elsifdef UNIX then 
puts(1, "UNIX") 
elsedef 
puts(1, "WINDOWS") 
end ifdef 
---- 

By the way, you are using the color names "Yellow" and "Bright Yellow", but Euphoria uses the names "Brown" and "Yellow" for those colors.

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

5. Re: std/graphcst.e colors in OSX - cont.

DerekParnell said...

Ok, that shows that you are running the correct library file. Now how about the other questions I asked about? You are sure making it hard for anyone to help you blink

Whoa dude! I answered all your questions. The answers are hosed on this forum!

said...

There are four other questions I asked.

  1. When you run text_color(3), what is the actual color you are seeing?
  2. When you run text_color(6), what is the actual color you are seeing?
  3. When you run eui -version, what exactly is being displayed?
  4. When you run the program below, what exactly is being displayed?
---- 
ifdef OSX then 
puts(1, "OSX") 
elsifdef UNIX then 
puts(1, "UNIX") 
elsedef 
puts(1, "WINDOWS") 
end ifdef 
---- 

By the way, you are using the color names "Yellow" and "Bright Yellow", but Euphoria uses the names "Brown" and "Yellow" for those colors.

Here are the answers to the above:

text_color(0) gives black 
           1    "   red 
           2    "   green 
           3    "   brown 
           4    "   blue 
           5    "   magenta 
           6    "   cyan 
           7    "   white 
           8    "   black 
           9    "   bright_red 
          10    "   bright_green 
          11    "   yellow 
          12    "   bright_blue 
          13    "   bright_magenta 
          14    "   bright_cyan 
          15    "   bright_white 
 
 
05:46 pm >> cat get_OS.ex 
ifdef OSX then  
puts(1, "OSX\n")  
elsifdef UNIX then  
puts(1, "UNIX\n")  
elsedef  
puts(1, "WINDOWS\n")  
end ifdef 
 
05:46 pm >> eui ./get_OS.ex 
OSX 
 
05:47 pm >> eui -version 
Euphoria Interpreter 4.0.0 development (r2681M) for OS X 
Using System Memory 
new topic     » goto parent     » topic index » view message » categorize

6. Re: std/graphcst.e colors in OSX - cont.

dukester said...

Whoa dude! I answered all your questions. The answers are hosed on this forum!

You used a "smiley" when dissing me, so I just repaid the compliment smile

           3    "   brown 
           6    "   cyan 

That's what you are supposed to be getting. So this means you have not got a color problem then, right? Or have I misunderstood what your problem was?

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

7. Re: std/graphcst.e colors in OSX - cont.

dukester said...

Here are the answers to the above:

text_color(0) gives black 
           7    "   white 
           8    "   black 

Curious that there is no gray on OSX. Eh.

Otherwise, that looks like the code in the include file matches what you _should_ be seeing on screen. And all the ifdefs seem correct as well.

The only issue is that you seem to be running a slightly older version of euphoria (the 2600s!) but that's probably the latest mac os x eubin that Jeremy has released.

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

8. Re: std/graphcst.e colors in OSX - cont.

jimcbrown said...
dukester said...

Here are the answers to the above:

text_color(0) gives black 
           7    "   white 
           8    "   black 

Curious that there is no gray on OSX. Eh.

Otherwise, that looks like the code in the include file matches what you _should_ be seeing on screen. And all the ifdefs seem correct as well.

The only issue is that you seem to be running a slightly older version of euphoria (the 2600s!) but that's probably the latest mac os x eubin that Jeremy has released.

This whole thread started when I posted this code:

07:01 pm >> cat demo52.ex 
-- demo program 52 
-- from Beginners Guide to Euphoria 
 
include graphics.e 
integer foreground_color 
sequence list_of_colors, already_used 
 
clear_screen() 
 
list_of_colors = {"BLUE","GREEN","CYAN","RED","MAGENTA","BROWN", 
                   "WHITE","GRAY","BRIGHT_BLUE","BRIGHT_GREEN", 
                   "BRIGHT_CYAN","BRIGHT_RED","BRIGHT_MAGENTA", 
                   "YELLOW","BRIGHT_WHITE"} 
 
already_used = {} 
 
for ix = 1 to 10 do 
     foreground_color = rand(15) 
     while find(foreground_color,already_used) do 
          foreground_color = rand(15) 
     end while 
     already_used = already_used & foreground_color 
     text_color(foreground_color) 
     printf(1, "Text in %s\n",{list_of_colors[foreground_color]}) 
end for 

to this forum, asking why the color of the text did not match what the text said that the color should be. The problem colors were blue and red, yellow and cyan. I asked if there was something wrong with the code itself - being new to Euphoria and all. The code still gives haywire results. I didn't know whether the code was at fault; graphics.e; or my OSX. Must be the code...

Thanks for all you guy's help.

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

9. Re: std/graphcst.e colors in OSX - cont.

dukester said...

This whole thread started when I posted this code:

07:01 pm >> cat demo52.ex 
-- demo program 52 
-- from Beginners Guide to Euphoria 
 
include graphics.e 
integer foreground_color 
sequence list_of_colors, already_used 
 
clear_screen() 
 
list_of_colors = {"BLUE","GREEN","CYAN","RED","MAGENTA","BROWN", 
                   "WHITE","GRAY","BRIGHT_BLUE","BRIGHT_GREEN", 
                   "BRIGHT_CYAN","BRIGHT_RED","BRIGHT_MAGENTA", 
                   "YELLOW","BRIGHT_WHITE"} 
 
already_used = {} 
 
for ix = 1 to 10 do 
     foreground_color = rand(15) 
     while find(foreground_color,already_used) do 
          foreground_color = rand(15) 
     end while 
     already_used = already_used & foreground_color 
     text_color(foreground_color) 
     printf(1, "Text in %s\n",{list_of_colors[foreground_color]}) 
end for 

to this forum, asking why the color of the text did not match what the text said that the color should be. The problem colors were blue and red, yellow and cyan. I asked if there was something wrong with the code itself - being new to Euphoria and all. The code still gives haywire results. I didn't know whether the code was at fault; graphics.e; or my OSX. Must be the code...

Thanks for all you guy's help.

Ah, yes, it is the code, the code is assuming Windows/DOS colors. Not OS/X colors. ABGTE was written before Euphoria ran on Mac OS X. (I think it was written before Mac OS X existed.)

Try this code below:

include graphics.e 
integer foreground_color 
sequence list_of_colors, already_used 
 
clear_screen() 
 
list_of_colors = {"RED","GREEN","BROWN","BLUE","MAGENTA","CYAN", 
                   "WHITE","GRAY","BRIGHT_RED","BRIGHT_GREEN", 
                   "YELLOW","BRIGHT_BLUE","BRIGHT_MAGENTA", 
                   "BRIGHT_CYAN","BRIGHT_WHITE"} 
 
already_used = {} 
 
for ix = 1 to 10 do 
     foreground_color = rand(15) 
     while find(foreground_color,already_used) do 
          foreground_color = rand(15) 
     end while 
     already_used = already_used & foreground_color 
     text_color(foreground_color) 
     printf(1, "Text in %s\n",{list_of_colors[foreground_color]}) 
end for 
new topic     » goto parent     » topic index » view message » categorize

10. Re: std/graphcst.e colors in OSX - cont.

jimcbrown said...

[snip]

Try this code below:

include graphics.e 
integer foreground_color 
sequence list_of_colors, already_used 
 
clear_screen() 
 
list_of_colors = {"RED","GREEN","BROWN","BLUE","MAGENTA","CYAN", 
                   "WHITE","GRAY","BRIGHT_RED","BRIGHT_GREEN", 
                   "YELLOW","BRIGHT_BLUE","BRIGHT_MAGENTA", 
                   "BRIGHT_CYAN","BRIGHT_WHITE"} 
 
already_used = {} 
 
for ix = 1 to 10 do 
     foreground_color = rand(15) 
     while find(foreground_color,already_used) do 
          foreground_color = rand(15) 
     end while 
     already_used = already_used & foreground_color 
     text_color(foreground_color) 
     printf(1, "Text in %s\n",{list_of_colors[foreground_color]}) 
end for 

Well it works! However, I don't understand why changing the order of the color names would matter? After all, we're randomly choosing an index number to access a color in the sequence. But it does... good eye! Thanks.

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

11. Re: std/graphcst.e colors in OSX - cont.

dukester said...

Well it works! However, I don't understand why changing the order of the color names would matter? After all, we're randomly choosing an index number to access a color in the sequence. But it does... good eye! Thanks.

It seems that the problem was that the demo program you ran assumed you'd be using Windows and not OSX.

Anyhow, I've updated graphcst.e and graphics.e so that the same color numbers can be used on all platforms now to mean the same color.

And here is a better program to demonstrate this.

---- 
include graphics.e  
integer foreground_color  
sequence list_of_colors, already_used  
  
text_color(BLACK)  
bk_color(WHITE) 
clear_screen()  
  
list_of_colors = {"BLACK", "BLUE","GREEN","CYAN","RED","MAGENTA","BROWN",  
                   "WHITE","GRAY","BRIGHT_BLUE","BRIGHT_GREEN",  
                   "BRIGHT_CYAN","BRIGHT_RED","BRIGHT_MAGENTA",  
                   "YELLOW","BRIGHT_WHITE", 
                   -- Now for the 'blinking' names 
                   "B-BLACK", "B-BLUE","B-GREEN","B-CYAN","B-RED","B-MAGENTA", 
                   "B-BROWN",  
                   "B-WHITE","B-GRAY","B-BRIGHT_BLUE","B-BRIGHT_GREEN",  
                   "B-BRIGHT_CYAN","B-BRIGHT_RED","B-BRIGHT_MAGENTA",  
                   "B-YELLOW","B-BRIGHT_WHITE", 
                   $}  
  
already_used = {}  
  
while length(already_used) < 31 do  
     while find(foreground_color,already_used) with entry do  
     entry 
          foreground_color = rand(32)-1  
     end while  
     already_used = already_used & foreground_color  
     text_color(foreground_color)  
     if find(foreground_color, {WHITE, WHITE + 16}) then 
     	bk_color(BLACK) 
     else 
     	bk_color(WHITE) 
     end if 
     printf(1, "Text in %s\n",{list_of_colors[foreground_color+1]})  
end while 
text_color(BLACK)  
bk_color(WHITE) 
---- 
new topic     » goto parent     » topic index » view message » categorize

12. Re: std/graphcst.e colors in OSX - cont.

The "text message" _still_ doesn't match the "text color" in your example. OTOH, jcb's example - in his most recent post - worked. That is, the "text message" matches the "text color".

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

13. Re: std/graphcst.e colors in OSX - cont.

dukester said...

The "text message" _still_ doesn't match the "text color" in your example. OTOH, jcb's example - in his most recent post - worked. That is, the "text message" matches the "text color".

No smiley this time ... you're making helping you harder than is needed.

It is no good telling helpers just what is NOT happening. I can't see your screen from here (Melbourne, Australia). So I don't know what you are actually seeing. You have told me what is not happening on your system, but I still don't know what is happening on your system.

Anyhow, I think I've worked out the problem though.

The program you are using has 'include graphics.e" instead of "include std/graphics.e". That means that it is picking up the v3 include file and not the v4 include file. Thus it is using the Windows color scheme instead of the OSX color scheme. So, change the include statement, rerun the program and tell me what you see.

Here is another program to run. If this is producing unexpected results, please show me the output from it AND tell me which color numbers are not matching the actual colors you see, AND tell me what colors you are seeing instead.

----- 
include std/graphics.e  
include std/io.e 
include std/text.e 
integer foreground_color  
  
text_color(BLACK)  
bk_color(WHITE) 
clear_screen()  
  
constant  
list_of_colors = {"BLACK", "BLUE","GREEN","CYAN","RED","MAGENTA","BROWN (TAN)",  
                   "WHITE (LIGHT-GRAY)","GRAY","BRIGHT_BLUE","BRIGHT_GREEN",  
                   "BRIGHT_CYAN","BRIGHT_RED","BRIGHT_MAGENTA",  
                   "YELLOW","BRIGHT_WHITE", 
                   $}  
  
  
for i = 1 to length(list_of_colors) do 
	foreground_color = i - 1 
	text_color(foreground_color)  
    if i < 9  then 
    	bk_color(BRIGHT_WHITE) 
    else 
    	bk_color(WHITE) 
    end if 
    writefln("[:40]", {format("Color #[z:2] is []",{foreground_color, list_of_colors[i]})} ) 
end for 
text_color(BLACK)  
bk_color(WHITE) 
---- 
new topic     » goto parent     » topic index » view message » categorize

14. Re: std/graphcst.e colors in OSX - cont.

Here's the output of your test script (with comments)

Color #00 is BLACK     -- no it's gray                  
Color #01 is BLUE      -- no it's red                  
Color #02 is GREEN     -- yes it's green    
Color #03 is CYAN      -- no it's brown                   
Color #04 is RED       -- no it's blue                          
Color #05 is MAGENTA   -- yes it's magenta                       
Color #06 is BROWN (TAN)   -- no it's cyan               
Color #07 is WHITE (LIGHT-GRAY)   -- must be, cuz I can't see the text on the background generated by the script         
Color #08 is GRAY   -- no it's black                       
Color #09 is BRIGHT_BLUE   -- no it's BRIGHT_RED                
Color #10 is BRIGHT_GREEN  -- YES it's BRIGHT-GREEN                
Color #11 is BRIGHT_CYAN   -- no it's YELLOW                
Color #12 is BRIGHT_RED    -- no, it's BRIGHT_BLUE                    
Color #13 is BRIGHT_MAGENTA  -- yes it's BRIGHT_MAGENTA              
Color #14 is YELLOW  -- no it's BRIGHT_CYAN  
new topic     » goto parent     » topic index » view message » categorize

15. Re: std/graphcst.e colors in OSX - cont.

dukester said...

Here's the output of your test script (with comments)

Thanks.

Your results do not make any sense to me at all. For example, color #0 is black on all platforms, yet you say it's gray!

It seems to me that the file called "graphcst.e" in the "std" folder is NOT the most recent one. For example, does it contain these lines ...

ifdef OSX then 
export constant true_color = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15, 
                              16,20,18,22,17,21,19,23,24,28,26,28,25,29,17,31} 
 

Is anyone else getting the same problems that dukester is reporting?

Until someone else starts reporting the same issue, I'm leaving this for now. It works here, and I can't see why it wouldn't work on any system that was correctly set up.

Please recheck that you have the latest include files, and they are in the right place, and the EUDIR and EUINC symbols are correct, and you have the correct color settings on your video display, etc , etc, etc ,etc ,etc etc...

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

16. Re: std/graphcst.e colors in OSX - cont.

DerekParnell said...
dukester said...

Here's the output of your test script (with comments)

Thanks.

Your results do not make any sense to me at all. For example, color #0 is black on all platforms, yet you say it's gray!

It seems to me that the file called "graphcst.e" in the "std" folder is NOT the most recent one. For example, does it contain these lines ...

ifdef OSX then 
export constant true_color = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15, 
                              16,20,18,22,17,21,19,23,24,28,26,28,25,29,17,31} 
 

The graphcst.e and graphics.e files in my ../include/std/ directory were not the latest and greatest. I had no idea that you had adjusted the code. Only after checking with http://rapideuphoria.svn.sourceforge.net/ did I see that you had significantly edited the code.

[snip]

Anyway, after scooping the latest version of the two files, the problem is now solved. Your last code modification solved the problem. The original "Beginners Guide to Euphoria" demo code, and your little test script display colors accurately now. Thanks for your efforts.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu