ACE3/addons/medical_gui/functions/fnc_damageToRGBA.sqf
Kyle Mckay e47e18001f
Docs - Update my display name everywhere (#9330)
* Update display name in team

* Update display name everywhere

* order

https://youtu.be/VYycQTm2HrM

---------

Co-authored-by: BrettMayson <brett@mayson.io>
2023-08-17 12:02:17 +02:00

24 lines
553 B
Plaintext

#include "script_component.hpp"
/*
* Author: ShackTac, kymckay
* Converts a damage value into a representative RGBA colour.
*
* Arguments:
* 0: The damage value (range [0,1]) <NUMBER>
*
* Return Value:
* Representative RGBA colour <ARRAY>
*
* Example:
* [0.4] call ace_medical_gui_fnc_damageToRGBA
*
* Public: No
*/
params ["_damage"];
private _frD = 0 max (_damage / DAMAGE_BLUE_THRESHOLD) min 1;
private _colorInt = ceil (_frD * (DAMAGE_TOTAL_COLORS - 1));
missionNamespace getVariable format ["%1_%2", QGVAR(damageColor), _colorInt]