[Include] PAWN Colour Manipulation
#1

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

Nice
Reply
#3

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.
Reply
#4

Nice
Reply
#5

Nice
Reply
#6

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)