Pixel-Composer/scripts/colToVec4/colToVec4.gml

13 lines
407 B
Plaintext
Raw Normal View History

2023-12-08 05:42:09 +01:00
function colToVec4(color, alpha = 1) {
2024-01-08 08:10:50 +01:00
var a = is_int64(color)? _color_get_alpha(color) : alpha;
return [ _color_get_red(color), _color_get_green(color), _color_get_blue(color), a ];
2023-12-08 05:42:09 +01:00
}
function colaToVec4(color) {
return [
((color & (0xFF << 0)) >> 0) / 255,
((color & (0xFF << 8)) >> 8) / 255,
((color & (0xFF << 16)) >> 16) / 255,
((color & (0xFF << 24)) >> 24) / 255,
];
}