Jump to content
Sign in to follow this  
funkheld

how can you please represent letters with different colors?

Recommended Posts

how can you please represent letters with different colors?


program is "fastbasic".


Thank you.

greeting



gr. 17
color 1

dpoke savmsc,ramadr

for k=0 to 50
x=rand(400)
poke (ramadr+x),32
next

post-31221-0-34764700-1552031362_thumb.jpg

Edited by funkheld

Share this post


Link to post
Share on other sites

thanks for teh help.

 

the color " red - yellow - green ?

 

 

greeting

Edited by funkheld

Share this post


Link to post
Share on other sites

Lines 15 to 30 are setting those, background was already black (which would be POKE 712,0)

The values are derived from the hue (color) and luminance (brightness) - e.g. a byte made of with a high nibble of hue and low nibble of lum. So hex $CA for light green in decimal is (12 * 16) + 10

Share this post


Link to post
Share on other sites

hello thanks.

 

greeting.

 

why are the colors the same here?
Thank you.
greeting
gr. 17
 
a=peek(88)+256*peek(89)
 
setcolor 708,11,15
poke a+1,32
setcolor 709,7,8
poke a+2,32
 
do
loop

 

post-31221-0-97453600-1552034835.jpg

Edited by funkheld

Share this post


Link to post
Share on other sites

You are poking the same character value '32'.

In the post I referenced, it states "a char value of 0-63 and the top two high bits control the colour of 0-3."

 

So 32 in hex is $20 or in binary 00100000 - the top 2 bits are 00 and so Color 0 is being used.

It looks like your 'setcolor' parameters are wrong, take a look at this page.

 

Therefore if you wanted color 1, you add 64, color 2, add 128 and color 3, add 192.

 

$20 = 00100000 = 32

$60 = 01100000 = 96

$A0 = 10100000 = 160

$E0 = 11100000 = 224
Maybe a word of warning, setting a colour before outputting a byte is not how the Atari functions.
The colour is determined by the value of the byte output.
If the colour was changed then if would change the colour of all characters associated with that register.
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...