Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

browserify example works but the colors are a bit close

  • Loading branch information...
commit dfb06c1e6e7fa93bbb2e38d4960bfc6eb157cdbb 1 parent cee5489
James Halliday authored
5 README.markdown
View
@@ -1,2 +1,7 @@
Mr. Color
=========
+
+I just want some colors, you know?
+
+This module gives you some colors which are all different but they get less
+different the more you want.
12 example/browser/index.html
View
@@ -0,0 +1,12 @@
+<html>
+ <head>
+ <title>Mr. Color, requisition me some colors post haste!</title>
+ <script type="text/javascript" src="/browserify.js"></script>
+ </head>
+ <body>
+ <div>
+ <input id="clicky" type="button" value="more colors!">
+ </div>
+ <div id="colors"></div>
+ </body>
+</html>
22 example/browser/main.js
View
@@ -0,0 +1,22 @@
+var mr = require('mrcolor');
+var $ = require('jquery-browserify');
+
+$(window).ready(function () {
+ var color = mr();
+
+ $('#clicky').click(function () {
+ var rgb = 'rgb(' + color.rgb().join(',') + ')';
+ color = color.next();
+
+ $('<div>')
+ .css({
+ 'background-color' : rgb,
+ color : 'white',
+ width : 500,
+ height : 30
+ })
+ .text(rgb)
+ .appendTo($('#colors'))
+ ;
+ });
+});
10 example/browser/server.js
View
@@ -0,0 +1,10 @@
+var express = require('express');
+var app = express.createServer();
+app.use(express.static(__dirname));
+
+var browserify = require('browserify');
+var bundle = browserify({ entry : __dirname + '/main.js' });
+app.use(bundle);
+
+app.listen(8080);
+console.log('Listening on :8080');
4 package.json
View
@@ -12,7 +12,9 @@
"color-convert" : "0.2.x"
},
"devDependencies" : {
- "expresso" : "0.7.x"
+ "expresso" : "0.7.x",
+ "jquery-browserify" : "1.6.x",
+ "browserify" : ">=1.2.8 <1.3"
},
"scripts" : {
"test" : "expresso"
Please sign in to comment.
Something went wrong with that request. Please try again.