SAMP hex color
#1

Hey guys, I was wondering if someone could help me understand this code a bit more... I'm used to the #FF0000 which would be red... but I do not understand the SAMP way in doing it. I am trying to create a dynamic organisation script and its not working because I can't seem to get the last characters right the (AA)

For example

#FF0000 is red

0xFF0000

But that doesn't make red the way it is... so how can I make it as red as #FF0000 is?
Reply
#2

It's 0xRRGGBBAA, AA being transparency, so red would be 0xFF0000FF, FF being the lowest transparency thus making the text most visible.
Reply
#3

The two are completely equivalent, the only difference is that pawn uses the constant symbol "0x" to denote hexadecimal instead of "#" which is already an operator. For more information check out my small article on hexadecimal: https://sampwiki.blast.hk/wiki/Hex.

Edit: Oh i think i understand what you were asking now, i apologize. See the above post, i apparently thought you were asking something completely different.
Reply
#4

Quote:
Originally Posted by Dodo9655
Посмотреть сообщение
It's 0xRRGGBBAA, AA being transparency, so red would be 0xFF0000FF, FF being the lowest transparency thus making the text most visible.
So for this color


Would I just use FF again to keep it the color it is there?

Edit:
On testing 0xFF0000FF it never came out as red, it came out as a really bright red mainly a pink color, so that didn't work out the way I expected it too...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)