sunjavagroups / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

colorhelper rgba regex does not pass for decimal opacity without a leading zero like '.5' instead of '0.5' #567

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
http://jsfiddle.net/XJZFZ/1/

Notice that the second row comes up as Invalid.

The problem is this regular expression on line 100:
/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[
0-9]+)?)\s*\)/

This can be corrected by changing the regular expression to:
/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[
0-9]+)?|\.[0-9]+)\s*\)/

As shown in this fiddle:
http://jsfiddle.net/XJZFZ/2/

Original issue reported on code.google.com by chris.mo...@gmail.com on 7 Jul 2011 at 2:45

GoogleCodeExporter commented 8 years ago
Patch.

Original comment by chris.mo...@gmail.com on 7 Jul 2011 at 3:02

Attachments:

GoogleCodeExporter commented 8 years ago
Am I posting this patch to the wrong place? Is Flot the wrong code tree to post 
ColorHelper fixes? At the very least the Flot portion of the patch resolves a 
standing issue with the Flot codebase itself.

Original comment by chris.mo...@gmail.com on 15 Jul 2011 at 8:59

GoogleCodeExporter commented 8 years ago

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 8:48

GoogleCodeExporter commented 8 years ago
Issue 603 has been merged into this issue.

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 8:48