Skip to content

Instantly share code, notes, and snippets.

@ashaw
Created April 19, 2011 16:50
Show Gist options
  • Save ashaw/928798 to your computer and use it in GitHub Desktop.
Save ashaw/928798 to your computer and use it in GitHub Desktop.
makeWidebar : function(e, sId) {
var that = this;
this.initialColor = this.getInitialColor(sId);
console.log(sId, this.initialColor)
this.initialColor = this.initialColor.match(/[0-9]{1,3}/g)
this.initialHsl = this.curHsl = rgbToHsl(this.initialColor[0], this.initialColor[1], this.initialColor[2]);
_(this.el).each(function(barSegment) {
that.curHsl[2] = that.curHsl[2] * .80;
that.curRgb = hslToRgb(that.curHsl[0], that.curHsl[1], that.curHsl[2]);
that.curRgb = _(that.curRgb).map(function(q) { return Math.floor(q) });
that.colorSegment(barSegment);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment