Skip to content

Commit

Permalink
fix color plugin index bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Nov 30, 2012
1 parent 2af097e commit 59503a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/plugins/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ module.exports = function() {
*/

function substitute(declarations) {
for (var i = 0, len = declarations.length; i < len; ++i) {
for (var i = 0; i < declarations.length; ++i) {
var decl = declarations[i];
var val = decl.value;
var i = val.indexOf('rgba');
if (-1 == i) continue;
var index = val.indexOf('rgba');
if (-1 == index) continue;

// grab rgba(...) value
var rgba = val.slice(i, val.indexOf(')', i));
var rgba = val.slice(index, val.indexOf(')', index));

// color
var c = rgba.slice(rgba.indexOf('(') + 1, rgba.indexOf(',')).trim();
Expand Down

0 comments on commit 59503a5

Please sign in to comment.