? Text colors: What the actual crap is going on? (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Text colors: What the actual crap is going on?

  • #1 ✎ 197 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies I'm pretty sure that at one point I knew how to do this, but I guess I forgot it, because I'm in trouble. So, FONTDEF, you can specify the color of a pixel with a hexadecimal string in the RGBA format, ex., F801, where—and I quote the help guide here—there are "5 bits for each RGB color (0-31) + alpha channel 1 bit (0: Transparent, 1: Opaque)" Okay, this is where my understanding breaks down. &HFF01 produces yellow pixels (15 in the red channel, 15 in the green channel, hoorah), yet, &H8801 produces dark red pixels (???) where I expected a slightly dimmer shade of yellow. It also seems that changing the alpha bit to something other than it's specified 1 bit state, say, F, changes the color in some way too (it literally states in the manual that the alpha is handled as a single bit). To make matters more degenerate in understanding, the manual also states that each RGB channel is handled as 5 bits, while F, "15," does not need 5 bits to define—it needs four. An extra straggler in the 2^4's place? Is it appending the alpha bit onto each RGB channel? What's going on here? All I'm trying to do is make a grey color lol How the actual crap does this work? Posted Edited by MZ952
  • #2 ✎ 1619 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Posted
  • #3 ✎ 197 MZ952 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Reading I like to read books! Hobbies
    A picture's worth a thousand lines of code. The method just seems odd to me, but when I step back it doesn't look like there's a better way. Yeah, this all makes a lot more sense now, thanks
    Posted