Skip to content
Browse files

Convert RGB values to integers before doing anything else with them

  • Loading branch information...
1 parent b3adae5 commit e3cd4964360b54bbe10c6d986baabbfaf7297230 @SebastianZ SebastianZ committed May 30, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 extension/content/firebug/lib/css.js
View
7 extension/content/firebug/lib/css.js
@@ -708,7 +708,12 @@ Css.rgbToHex = function(value)
Css.rgbToHSL = function(value)
{
return value.replace(/\brgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(,\s*(\d.\d+|\d))?\)/gi,
- function(_, r, g, b, _, a) {
+ function(_, r, g, b, _, a)
+ {
+ r = parseInt(r);
+ g = parseInt(g);
+ b = parseInt(b);
+
var gray = (r == g && g == b);
r /= 255;

0 comments on commit e3cd496

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