mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-28 04:55:12 +00:00
Remove redundant escapes
This commit is contained in:
@@ -188,8 +188,8 @@ colorString.get.rgb = function(string) {
|
||||
|
||||
const abbr = /^#([a-f0-9]{3,4})$/i;
|
||||
const hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
|
||||
const rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
|
||||
const per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
|
||||
const rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/;
|
||||
const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/;
|
||||
const keyword = /(\D+)/;
|
||||
|
||||
let rgb = [0, 0, 0, 1];
|
||||
@@ -269,7 +269,7 @@ colorString.get.hsl = function(string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const hsl = /^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
|
||||
const hsl = /^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/;
|
||||
const match = string.match(hsl);
|
||||
|
||||
if (match) {
|
||||
@@ -290,7 +290,7 @@ colorString.get.hwb = function(string) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const hwb = /^hwb\(\s*([+-]?\d*[\.]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/;
|
||||
const hwb = /^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/;
|
||||
const match = string.match(hwb);
|
||||
|
||||
if (match) {
|
||||
|
||||
Reference in New Issue
Block a user