Posts: 352
Threads: 37
Joined: Jun 2012
30.09.2018, 15:27
(
Последний раз редактировалось kristo; 16.04.2019 в 17:45.
)
Posts: 352
Threads: 37
Joined: Jun 2012
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.
Posts: 1,046
Threads: 29
Joined: Mar 2010
Posts: 352
Threads: 37
Joined: Jun 2012
29.01.2019, 17:39
(
Последний раз редактировалось kristo; 29.01.2019 в 19:44.
)
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;
}