Colors simplier to read
#1

Hello everybody.
Usually a color is defined in that way:
pawn Код:
#define COLOR_RED 0xFF006600
This way the hex-code isn't that clear to read (FF0066). So I wanted to make it a little bit clearer:
pawn Код:
#define c(%1) 0x%100
#define COLOR_RED c(FF0066)
But now the color is black everytime. In my opinion it is because the code cuts the 0 (from the 0x in front). But I don't really know why. Is there a way to do this more easily or at least without the bug?

And yeah, I know it's pretty senseless, no need to mention that :P

Thanks in advance.
Padarom
Reply
#2

Define the color :

pawn Код:
#define COLOR_RED 0xFF006600
And Use in this function , only a example:

pawn Код:
SendClientMessage(playerid, COLOR_RED, "Message");
This is more easily.
Reply
#3

Ermm - Yeah, that's the way I mentioned first. But I want to make the hex code easier to read. Even if it's increasing the line numbers (1 more line), the color would be easier to define or change - Due to the clear hex.

Just ignore if you think this is useless, but I still would love to have a solution for that.
Reply
#4

#define c(%1) 0x%100
#define COLOR_RED c(FF0066)
hmm why u did 100 isnt it supposed to be 00 ?
Reply
#5

Quote:
Originally Posted by Niko_boy
Посмотреть сообщение
#define c(%1) 0x%100
#define COLOR_RED c(FF0066)
hmm why u did 100 isnt it supposed to be 00 ?
The macro is using %1. 0x %1 00 is what he actually has.
Reply
#6

ahhah yeah
didnt thought of that but the macro doesnt become 100 if he type like that loL?
%100 instead of %1 00
I guesss no ?
Reply
#7

Well if I would use %1 00 (instead of %100) I would get errors when using the color:
pawn Код:
error 001: expected token: ",", but found "-integer value-"
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply
#8

http://www.colorpicker.com/
Reply
#9

can u use like
#define AlPha 00
#define c(%1) 0x%1AlPha
#define COLOR_RED c(FF0066)
NO ?
i am doing it wrong anyways :P?
Reply
#10

Yeah MP2, that's the website I get my colors from. And why did you post it?
It doesn't have anything to do with my matter.

@Niko: Nope, it doesn't recognize the Alpha as a defined number (undefined symbol "xD10054Alpha")
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)