diff --git a/scripts/colToVec4/colToVec4.gml b/scripts/colToVec4/colToVec4.gml new file mode 100644 index 000000000..7a6a1c0ac --- /dev/null +++ b/scripts/colToVec4/colToVec4.gml @@ -0,0 +1,12 @@ +function colToVec4(color, alpha = 1) { + return [ color_get_red(color) / 255, color_get_green(color) / 255, color_get_blue(color) / 255, alpha ]; +} + +function colaToVec4(color) { + return [ + ((color & (0xFF << 0)) >> 0) / 255, + ((color & (0xFF << 8)) >> 8) / 255, + ((color & (0xFF << 16)) >> 16) / 255, + ((color & (0xFF << 24)) >> 24) / 255, + ]; +} \ No newline at end of file diff --git a/scripts/colToVec4/colToVec4.yy b/scripts/colToVec4/colToVec4.yy new file mode 100644 index 000000000..4008cd594 --- /dev/null +++ b/scripts/colToVec4/colToVec4.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "colToVec4", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "shader", + "path": "folders/functions/shader.yy", + }, +} \ No newline at end of file