mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-26 06:56:45 +01:00
13 lines
No EOL
407 B
Text
13 lines
No EOL
407 B
Text
function colToVec4(color, alpha = 1) {
|
|
var a = is_int64(color)? _color_get_alpha(color) : alpha;
|
|
return [ _color_get_red(color), _color_get_green(color), _color_get_blue(color), a ];
|
|
}
|
|
|
|
function colaToVec4(color) {
|
|
return [
|
|
((color & (0xFF << 0)) >> 0) / 255,
|
|
((color & (0xFF << 8)) >> 8) / 255,
|
|
((color & (0xFF << 16)) >> 16) / 255,
|
|
((color & (0xFF << 24)) >> 24) / 255,
|
|
];
|
|
} |