Skip to content
Browse files

Clean up

  • Loading branch information...
1 parent 782ab50 commit 06f17e5c52e12c338dd5205ca1499109d140b1de @afriggeri committed Apr 12, 2012
Showing with 7 additions and 9 deletions.
  1. +6 −4 ryb.coffee
  2. +1 −5 ryb.js
View
10 ryb.coffee
@@ -1,6 +1,4 @@
-cbrt = (x) ->
- (if x < 0 then - 1 else 1) * Math.pow(Math.abs(x), 1/3)
-
+## RYB colorspace
RYB =
white: [1,1,1]
red: [1,0,0]
@@ -35,7 +33,9 @@ class Points extends Array
@plength = 0
distance: (p1) ->
- [0..2].map((i) => Math.pow(p1[i] - @picked[i], 2)).reduce((a,b) -> a+b)
+ [0..2].map((i) =>
+ Math.pow(p1[i] - @picked[i], 2)
+ ).reduce((a,b) -> a+b)
pick: () ->
unless @picked?
@@ -51,6 +51,8 @@ class Points extends Array
@plength++
return pick
+# Interface stuff, no need to use jQuery here
+
generate = document.getElementById('generate')
numberColors = document.getElementById('number-colors')
display = document.getElementById('colors')
View
6 ryb.js
@@ -1,12 +1,8 @@
// Generated by CoffeeScript 1.3.1
-var Points, RYB, cbrt, display, generate, generateColors, numberColors,
+var Points, RYB, display, generate, generateColors, numberColors,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
-cbrt = function(x) {
- return (x < 0 ? -1 : 1) * Math.pow(Math.abs(x), 1 / 3);
-};
-
RYB = {
white: [1, 1, 1],
red: [1, 0, 0],

0 comments on commit 06f17e5

Please sign in to comment.
Something went wrong with that request. Please try again.