diff options
author | wout <wout@impinc.co.uk> | 2013-03-06 19:43:17 +0000 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-03-06 19:43:17 +0000 |
commit | 5e3ff072994d3d9b224c62d71ca1331951249bac (patch) | |
tree | 9bb8b5af1ca4372fcf0c03b0444530fefee20735 /src/regex.js | |
parent | 6a8a3fee7dbfc9a9f4a36dc5877f955f5743a4ac (diff) | |
download | svg.js-5e3ff072994d3d9b224c62d71ca1331951249bac.tar.gz svg.js-5e3ff072994d3d9b224c62d71ca1331951249bac.zip |
Reworked color management
Diffstat (limited to 'src/regex.js')
-rw-r--r-- | src/regex.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/regex.js b/src/regex.js index 7ecb557..e89dc85 100644 --- a/src/regex.js +++ b/src/regex.js @@ -1,7 +1,18 @@ // Storage for regular expressions SVG.regex = { - unit: /^([\d\.]+)([a-z%]{0,2})$/ + unit: /^([\d\.]+)([a-z%]{0,2})$/ + +, hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i + +, rgb: /rgb\((\d+),(\d+),(\d+),([\d\.]+)\)/ + +, hsb: /hsb\((\d+),(\d+),(\d+),([\d\.]+)\)/ + +, isHex: /^#/i + +, isRgb: /^rgb\(/ + +, isHsb: /^hsb\(/ -, hex: /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i }
\ No newline at end of file |