SA-MP Forums Archive
[Include] PAWN Colour Manipulation - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] PAWN Colour Manipulation (/showthread.php?tid=659336)



PAWN Colour Manipulation - kristo - 30.09.2018

https://www.**************/showthread.php?tid=284


Re: PAWN Colour Manipulation - SyS - 30.09.2018

Nice


Re: PAWN Colour Manipulation - kristo - 30.09.2018

Quote:
Originally Posted by ******
Посмотреть сообщение
Why a gamma correction of 2.4 not 2.2?
This is the formula from the sRGB specification, the formula that simply raises the value to the power of 2.2 is a simplification of the other one, but it's still very close. I found this out from here when looking for a formula to get the gamma of a colour.


Re: PAWN Colour Manipulation - Zeth - 01.10.2018

Nice


Re: PAWN Colour Manipulation - BigETI - 01.10.2018

Nice


Re: PAWN Colour Manipulation - kristo - 29.01.2019

I present to you, a non-clusterfuck version of ProxDetector using this library:

pawn Код:
stock SendFadingMessage(playerid, Float:range, start_colour, end_colour, const message[]) {
    if (!IsPlayerConnected(playerid) || range < 0.0) {
        return 0;
    }

    new Float:ratio, Float:x, Float:y, Float:z, vw = GetPlayerVirtualWorld(playerid);
    GetPlayerPos(playerid, x, y, z);

    foreach (new i : Player) {
        if (GetPlayerVirtualWorld(i) != vw || (ratio = (GetPlayerDistanceFromPoint(i, x, y, z) / range)) > 1.0) {
            continue;
        }

        SendClientMessage(i, InterpolateColours(start_colour, end_colour, ratio), message);
    }

    return 1;
}