Color codes

Code:
Color    = ## [Token]
Blue     = 10 [$EF41]
Red      = 11 [$EF42]
Black    = 12 [$EF43]
Magenta  = 13 [$EF44]
Green    = 14 [$EF45]
Orange   = 15 [$EF46]
Brown    = 16 [$EF47]
Navy     = 17 [$EF48]
LtBlue   = 18 [$EF49]
Yellow   = 19 [$EF4A]
White    = 20 [$EF4B]
LtGray   = 21 [$EF4C]
MedGray  = 22 [$EF4D]
Gray     = 23 [$EF4E]
DarkGray = 24 [$EF4F]


You can use these as numbers. So, for example:

Code:
If A=1:Then
BLACK->C
Else
BLUE->C
End
Circle(50,50,50,2,1,C

works fine. It also means that BLUE*2=WHITE, which is a bit strange.

Please feel free to add additional facts for the 84+CSE below, an Admin will tack them up in to this post.
Doing operations with the colors uses the color values.

LTGRAY*2 = the answer to life the universe and everything
Are those 2-bytes tokens? If they're 1 byte large, they could possibly be used for some minor optimizations Razz
They are two bytes, $EF41-$EF4F.
This morning, I found evidence that the Text( command DOES support background colors. Though it only seems to be from 3 colors that I found, 19, 20 and 21. It'd be great if Kerm could follow up with TI on the why this is only set up for 3 colors, and not all of them.

It'd be nice to have TextColor(<text>,<background> as a set up.
Can you give more details on how to do it?
Can you do 2LTGRAY to get 42? I think that that may be faster than saying 42 because LTGRAY is already equated to 2A in hex? maybe??
merthsoft wrote:
Can you give more details on how to do it?


Just set TextColor( to those values and display Text( with whatever you want. It changes the background color, but the text color itself is wonky.
Forty-Two: yes, it seems you can use them as numerical constants.

TIFreak8x: Those background seem to be fixed. We still don't know of a way to control them. Smile
Maybe so, but I'd love to hear from TI on why they did it that way. Out of 14 colors, 3 of them have backgrounds with colors way off text wise than what you were trying to shoot for. Plus I'd love them to implement my idea on how to set the background color for the text :p
tifreak8x wrote:
Maybe so, but I'd love to hear from TI on why they did it that way. Out of 14 colors, 3 of them have backgrounds with colors way off text wise than what you were trying to shoot for. Plus I'd love them to implement my idea on how to set the background color for the text :p
The other colors of text have white rather than transparent backgrounds. Smile I think they just tried to pick contrasting colors so that text of any color would be visible on any color background.
Also I don't get why they chose THAT color as background for light gray, yellow and white text. They should have chosen black or something, because light gray on medium gray is definitively not very easy to read.
KermMartian wrote:
tifreak8x wrote:
Maybe so, but I'd love to hear from TI on why they did it that way. Out of 14 colors, 3 of them have backgrounds with colors way off text wise than what you were trying to shoot for. Plus I'd love them to implement my idea on how to set the background color for the text :p
The other colors of text have white rather than transparent backgrounds. Smile I think they just tried to pick contrasting colors so that text of any color would be visible on any color background.


Which means that, technically, it's already all set up and ready to go in there for us to be able to choose our own backgrounds for Text(. That's all I'm getting at, and they can do it within TextColor(, which wouldn't kill compatibility at all using the Text( command. Smile
Ahh, gotcha, then I agree. And I bet once we start delving into things like _Vputs some more, we'll find flags for text foreground and background colors, which will at least make an ASM stub or Hybrid BASIC library available. Smile As you say, though, it would be even cleaner if they would expose the background color somehow.
I really want my dual layer ASCII back D:

Unless we convince TI to give us more Text( modes and settings, or until someone makes a proper set of hybrid BASIC libraries, I'm afraid you're SOL. Sad That certainly sounds like something that needs to be added to the list of functions programmers would want in a hybrid library, though.
Via hybrid libraries it would be nice. Oh well, for now there are always text sprites (although they'll obviously be slower and look blocky)
For values 10 to 24, since those would require 2 bytes anyways, we won't get a size optimisation, but it won't cost us any bytes and it might be faster to use these than other methods. Has anybody tested the speeds of these tokens compared to using an equivalent number?
For those interested in RGB colors for the indexed colors, here they are (thanks to SourceCoder 3). Note that these are decimal and in (R5,G6,B5) format; to get (R8,G8,B8), multiply by (8,4,8).
Code:
1 = array(0,0,31)
2 = array(31,0,0)
3 = array(0,0,0)
4 = array(31,0,31)
5 = array(0,39,0)
6 = array(31,35,4)
7= array(22,8,0)
8 = array(0,0,15)
9 = array(0,36,31)
10 = array(31,63,0)
11 = array(31,63,31)
12 = array(28,56,28)
13 = array(24,48,24)
14 = array(17,34,17)
15 = array(10,21,10)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement