SA-MP Forums Archive
[SOLVED] How to make a color darker - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [SOLVED] How to make a color darker (/showthread.php?tid=153749)



[SOLVED] How to make a color darker - RyDeR` - 10.06.2010

Hi,
Like in the subject.. How can I make a color two times darker? I know I can use 2 different colors but I just want to use this color: 0x7DFF00FF

Examples:
This is the starting color.
This will be the output.


Re: How to make a color two times darker - RyDeR` - 10.06.2010

Got it.

pawn Code:
#if !defined MakeColorDark
#define MakeColorDark(%0) \
    (%0 & 0xFFFFFF00) | (0x66 & ((%0 & 0x000000FF) / 3))
#endif
Problem solved.


Re: Problem Solved.. - Jackster - 10.06.2010

Why don't you name this 1 acordily so if someone did want to find out they could see the title?


Re: [SOLVED] How to make a color darker - RyDeR` - 10.06.2010

Quote:
Originally Posted by Jackster
Why don't you name this 1 acordily so if someone did want to find out they could see the title?
True.
Done..


Re: [SOLVED] How to make a color darker - Jackster - 10.06.2010

Thanks


Re: [SOLVED] How to make a color darker - Musty80 - 10.06.2010

Ryder Gel Pawn Цgreteyim

English

Come Pawn Ryder Teaching


Re: [SOLVED] How to make a color darker - RyDeR` - 10.06.2010

Quote:
Originally Posted by [PWN
CфDйR™ ]
Ryder Gel Pawn Цgreteyim

English

Come Pawn Ryder Teaching
lol, gtfo.. What are you trying to say?


Re: How to make a color two times darker - Jonny5 - 29.06.2012

Quote:
Originally Posted by RyDeR`
View Post
Got it.

pawn Code:
#if !defined MakeColorDark
#define MakeColorDark(%0) \
    (%0 & 0xFFFFFF00) | (0x66 & ((%0 & 0x000000FF) / 3))
#endif
Problem solved.
anyway we can edit this to make a color lighter?


Re: How to make a color two times darker - WillyP - 29.06.2012

Quote:
Originally Posted by Jonny5
View Post
anyway we can edit this to make a color lighter?
Why the fuck did you bump a 2 YEAR old topic?


Re: How to make a color two times darker - iggy1 - 29.06.2012

Quote:
Originally Posted by [FU]Victious
View Post
Why the fuck did you bump a 2 YEAR old topic?
It's better than creating a new thread on the same subject.