diff --git a/index.html b/index.html
index 1fddfd7..2f399c7 100644
--- a/index.html
+++ b/index.html
@@ -14,7 +14,6 @@
-
@@ -26,6 +25,7 @@
+
@@ -50,7 +50,6 @@
diff --git a/scripts/core/cursor.js b/scripts/core/cursor.js
index f2f37f4..7e8ee41 100644
--- a/scripts/core/cursor.js
+++ b/scripts/core/cursor.js
@@ -6,9 +6,9 @@ function Cursor()
this.update = function(event)
{
if(event.ctrltKey === true && event.altKey === true && event.shiftKey === true){ /* */ }
- else if(event.shiftKey === true && event.ctrlKey === true){ this.set_mode(ronin.planner); }
- else if(event.shiftKey === true && event.altKey === true){ this.set_mode(ronin.canvas); }
- else if(event.ctrltKey === true && event.altKey === true){ /* */ }
+ else if(event.shiftKey === true && event.ctrlKey === true){ this.set_mode(ronin.eye); }
+ else if(event.shiftKey === true && event.altKey === true){ this.set_mode(ronin.canvas); }
+ else if(event.ctrltKey === true && event.altKey === true){ this.set_mode(ronin.eye); }
else if(event.ctrlKey === true){ this.set_mode(ronin.overlay); }
else if(event.altKey === true){ this.set_mode(ronin.surface); }
else if(event.shiftKey === true){ this.set_mode(ronin.eraser); }
diff --git a/scripts/core/ronin.js b/scripts/core/ronin.js
index f825d0c..ea4c785 100644
--- a/scripts/core/ronin.js
+++ b/scripts/core/ronin.js
@@ -15,8 +15,8 @@ function Ronin()
this.help = new Help("?");
this.history = new History("^");
this.eraser = new Eraser(".");
- this.planner = new Planner("*");
this.surface = new Surface("#");
+ this.eye = new Eye("*");
this.cursor = new Cursor();
@@ -31,8 +31,8 @@ function Ronin()
this.modules[this.help.rune] = this.help;
this.modules[this.history.rune] = this.history;
this.modules[this.eraser.rune] = this.eraser;
- this.modules[this.planner.rune] = this.planner;
this.modules[this.surface.rune] = this.surface;
+ this.modules[this.eye.rune] = this.eye;
this.cursors = [];
diff --git a/scripts/modules/eye.js b/scripts/modules/eye.js
new file mode 100644
index 0000000..443945e
--- /dev/null
+++ b/scripts/modules/eye.js
@@ -0,0 +1,45 @@
+function Eye(rune)
+{
+ Module.call(this,rune);
+
+ // Module
+
+ this.active = function(cmd)
+ {
+ }
+
+ this.passive = function(cmd)
+ {
+ }
+
+ this.widget_cursor = function()
+ {
+ return "Eye";
+ }
+
+ this.color_picker = function(position)
+ {
+ var imgData = ronin.canvas.context().getImageData(position.x, position.y, 1, 1).data;
+ var c = new Color();
+ commander.show();
+ commander.element_input.focus();
+ commander.element_input.value = "> "+(c.rgb_to_hex(imgData));
+ }
+
+ // Cursor
+
+ this.mouse_down = function(position)
+ {
+ this.color_picker(position);
+ }
+
+ this.mouse_move = function(position)
+ {
+ this.color_picker(position);
+ }
+
+ this.mouse_up = function(position)
+ {
+ this.color_picker(position);
+ }
+}
\ No newline at end of file
diff --git a/scripts/modules/planner.js b/scripts/modules/planner.js
deleted file mode 100644
index 38e78d7..0000000
--- a/scripts/modules/planner.js
+++ /dev/null
@@ -1,9 +0,0 @@
-function Planner(rune)
-{
- Module.call(this,rune);
-
- this.widget_cursor = function()
- {
- return "Planner";
- }
-}
\ No newline at end of file
diff --git a/scripts/units/color.js b/scripts/units/color.js
index b6014f0..9cf1d67 100644
--- a/scripts/units/color.js
+++ b/scripts/units/color.js
@@ -24,4 +24,9 @@ function Color(hex = '#000000')
{
return this.hex;
}
+
+ this.rgb_to_hex = function(rgb)
+ {
+ return "#"+("0" + parseInt(rgb[0],10).toString(16)).slice(-2)+("0" + parseInt(rgb[1],10).toString(16)).slice(-2)+("0" + parseInt(rgb[2],10).toString(16)).slice(-2);
+ }
}
\ No newline at end of file