diff --git a/src/modules/saving/templates/light.ts b/src/modules/saving/templates/light.ts
index 96a1fd1..ab273f9 100644
--- a/src/modules/saving/templates/light.ts
+++ b/src/modules/saving/templates/light.ts
@@ -24,6 +24,8 @@ const lightTemplate: PartialTemplate = {
         activation: `
             const { main, active } = context.colors
 
+            const bits = context.get(0)
+
             context.color(parseInt(context.get(0),2) ? active : main)
         `
     },
diff --git a/src/modules/saving/templates/rgb.ts b/src/modules/saving/templates/rgb.ts
index a55c4a6..b4e0069 100644
--- a/src/modules/saving/templates/rgb.ts
+++ b/src/modules/saving/templates/rgb.ts
@@ -22,15 +22,20 @@ const rgbLightTemplate: PartialTemplate = {
     },
     code: {
         activation: `
-            const get = (index) => context.getBinary(index) & 1
-            const color = (get(0) << 2) + (get(1) << 1) + get(2)
+            const get = (index) => context.get(index)
+            
+            const colors = Array.from({ length: 3 }, (_, index) => {
+                const bits = get(index)
+                const max = 2 ** bits.length - 1
+                return 256 * parseInt(bits, 2) / max
+            })
 
-            if (color === 0){
+            if (colors.reduce((curr, acc) => acc + curr, 0) === 0){
                 context.color(context.colors.main)
             }
 
             else {
-                context.color(context.colors[color])
+                context.color(\`rgb(\${colors.join(",")})\`)
             }
         `
     },