Permalink
Browse files

correcting some issues with HSL

  • Loading branch information...
1 parent c4903fa commit 6ff9b82c6197addd88ffc0c0c07da3ad34456264 @heygrady committed May 20, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 jquery.textshadow.js
  2. +1 −1 readme.md
View
@@ -1,7 +1,7 @@
(function($, window, undefined) {
//regex
var rtextshadow = /([\d+.\-]+[a-z%]*)\s*([\d+.\-]+[a-z%]*)\s*([\d+.\-]+[a-z%]*)?\s*([#a-z]*.*)?/,
- rcolor= /(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\.\d]+))?/,
+ rcolor= /(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)%?\s*,\s*(\d+)%?(?:\s*,\s*([\.\d]+))?/,
filter = "progid:DXImageTransform.Microsoft.",
rspace = /(\s*)/g;
@@ -159,7 +159,7 @@
var matches = rcolor.exec(color), rgb;
// handle hsl
- if (matches && matches[1] === 'hsla') {
+ if (matches && matches[1] === 'hsl') {
rgb = hsl2rgb(matches[2], matches[3], matches[4]);
matches[2] = rgb[0];
matches[3] = rgb[1];
View
@@ -25,7 +25,7 @@ It is recommended to use this library with a feature detection library such as [
$('h1').textshadow('2px 2px 2px rgba(0, 0, 0, 0.5)');
// hsla
- $('h1').textshadow('2px 2px 2px hsla(0, 0, 0, 0.5)');
+ $('h1').textshadow('2px 2px 2px hsla(0, 100%, 54%, .5)');
}
There is a corresponding css file that provides base styles for the new elements used. It must be included in the document as well.

0 comments on commit 6ff9b82

Please sign in to comment.