mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-12 21:03:32 -06:00
Initial commit
This commit is contained in:
173
node_modules/synesthesia/README.md
generated
vendored
Normal file
173
node_modules/synesthesia/README.md
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
Synesthesia
|
||||
===========
|
||||
[](http://badge.fury.io/js/synesthesia)
|
||||
[](https://travis-ci.org/Munter/synesthesia)
|
||||
[](https://coveralls.io/r/Munter/synesthesia)
|
||||
[](https://david-dm.org/Munter/synesthesia)
|
||||
|
||||
A collection og regular expressions to find occurences of valid color syntaxes.
|
||||
|
||||
It can match hex syntaxes, rgb, rgba, hsv, hsva, hsl, hsla and CSS color names.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
Consider the following setup:
|
||||
|
||||
``` javascript
|
||||
// Let's get some color in here
|
||||
var colorString = [
|
||||
'red green blue',
|
||||
'#FF0000 #00FF00 #0000FF',
|
||||
'#F00 #0F0 #00F',
|
||||
'rgb(255, 0, 0) rgb(0, 255, 0), rgb(0, 0, 255)',
|
||||
'rgba(255, 0, 0, 0.5) rgba(0, 255, 0, 0.5), rgba(0, 0, 255, 0.5)',
|
||||
'hsv(0, 100%, 100%) hsv(120, 100%, 100%) hsv(240, 100%, 100%)',
|
||||
'hsva(0, 100%, 100%, 0.5) hsva(120, 100%, 100%, 0.5) hsva(240, 100%, 100%, 0.5)',
|
||||
'hsl(0, 100%, 100%) hsl(120, 100%, 100%) hsl(240, 100%, 100%)',
|
||||
'hsla(0, 100%, 100%, 0.5) hsla(120, 100%, 100%, 0.5) hsla(240, 100%, 100%, 0.5)'
|
||||
].join(', ');
|
||||
|
||||
var synesthesia = require('synesthesia');
|
||||
```
|
||||
|
||||
##### Hex color matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.hex);
|
||||
|
||||
[ '#FF0000',
|
||||
'#00FF00',
|
||||
'#0000FF',
|
||||
'#F00',
|
||||
'#0F0',
|
||||
'#00F' ]
|
||||
```
|
||||
|
||||
##### RGB color matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.rgb);
|
||||
|
||||
[ 'rgb(255, 0, 0)',
|
||||
'rgb(0, 255, 0)',
|
||||
'rgb(0, 0, 255)' ]
|
||||
```
|
||||
|
||||
##### RGBA color matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.rgba);
|
||||
|
||||
[ 'rgba(255, 0, 0, 0.5)',
|
||||
'rgba(0, 255, 0, 0.5)',
|
||||
'rgba(0, 0, 255, 0.5)' ]
|
||||
```
|
||||
|
||||
##### HSV color matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.hsv);
|
||||
|
||||
[ 'hsv(0, 100%, 100%)',
|
||||
'hsv(120, 100%, 100%)',
|
||||
'hsv(240, 100%, 100%)' ]
|
||||
```
|
||||
|
||||
##### HSVA color matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.hsva);
|
||||
|
||||
[ 'hsva(0, 100%, 100%, 0.5)',
|
||||
'hsva(120, 100%, 100%, 0.5)',
|
||||
'hsva(240, 100%, 100%, 0.5)' ]
|
||||
```
|
||||
|
||||
##### HSL color matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.hsl);
|
||||
|
||||
[ 'hsl(0, 100%, 100%)',
|
||||
'hsl(120, 100%, 100%)',
|
||||
'hsl(240, 100%, 100%)' ]
|
||||
```
|
||||
|
||||
##### HSLA color matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.hsla);
|
||||
|
||||
[ 'hsla(0, 100%, 100%, 0.5)',
|
||||
'hsla(120, 100%, 100%, 0.5)',
|
||||
'hsla(240, 100%, 100%, 0.5)' ]
|
||||
```
|
||||
|
||||
##### CSS color names matching:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.names);
|
||||
|
||||
[ 'red', 'green', 'blue' ]
|
||||
```
|
||||
|
||||
##### And now all together:
|
||||
|
||||
``` javascript
|
||||
colorString.match(synesthesia.all);
|
||||
|
||||
[ 'red',
|
||||
'green',
|
||||
'blue',
|
||||
'#FF0000',
|
||||
'#00FF00',
|
||||
'#0000FF',
|
||||
'#F00',
|
||||
'#0F0',
|
||||
'#00F',
|
||||
'rgb(255, 0, 0)',
|
||||
'rgb(0, 255, 0)',
|
||||
'rgb(0, 0, 255)',
|
||||
'rgba(255, 0, 0, 0.5)',
|
||||
'rgba(0, 255, 0, 0.5)',
|
||||
'rgba(0, 0, 255, 0.5)',
|
||||
'hsv(0, 100%, 100%)',
|
||||
'hsv(120, 100%, 100%)',
|
||||
'hsv(240, 100%, 100%)',
|
||||
'hsva(0, 100%, 100%, 0.5)',
|
||||
'hsva(120, 100%, 100%, 0.5)',
|
||||
'hsva(240, 100%, 100%, 0.5)',
|
||||
'hsl(0, 100%, 100%)',
|
||||
'hsl(120, 100%, 100%)',
|
||||
'hsl(240, 100%, 100%)',
|
||||
'hsla(0, 100%, 100%, 0.5)',
|
||||
'hsla(120, 100%, 100%, 0.5)',
|
||||
'hsla(240, 100%, 100%, 0.5)' ]
|
||||
```
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Peter Müller <munter@fumle.dk>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
17
node_modules/synesthesia/lib/channels.js
generated
vendored
Normal file
17
node_modules/synesthesia/lib/channels.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
var ranges = require('./ranges');
|
||||
|
||||
var channelWithDecimalPointPercentageTpl = '\\s*(?:\\.\\d+|_NUMBERS_(?:\\.\\d+)?)%\\s*',
|
||||
channelWithDecimalPointTpl = channelWithDecimalPointPercentageTpl.replace('%', ''),
|
||||
|
||||
// Channels
|
||||
percentageChannel = new RegExp(channelWithDecimalPointPercentageTpl.replace('_NUMBERS_', ranges['100'].source)),
|
||||
eightBitChannel = new RegExp(channelWithDecimalPointTpl.replace('_NUMBERS_', ranges['255'].source)),
|
||||
hueChannel = new RegExp(channelWithDecimalPointTpl.replace('_NUMBERS_', ranges['360'].source)),
|
||||
alphaChannel = new RegExp(channelWithDecimalPointTpl.replace('_NUMBERS_', ranges['1'].source));
|
||||
|
||||
module.exports = {
|
||||
eightBit: eightBitChannel,
|
||||
hue: hueChannel,
|
||||
percentage: percentageChannel,
|
||||
alpha: alphaChannel
|
||||
};
|
47
node_modules/synesthesia/lib/index.js
generated
vendored
Normal file
47
node_modules/synesthesia/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
var colorNames = require('css-color-names');
|
||||
var channels = require('./channels');
|
||||
|
||||
// Space templates
|
||||
var opaqueSpaceTpl = '_space_\\(_1_,_2_,_3_\\)';
|
||||
var alphaSpaceTpl = '_space_a\\(_1_,_2_,_3_,_a_\\)'.replace('_a_', channels.alpha.source);
|
||||
|
||||
var spaces = {
|
||||
hex: /#(?:[0-9a-f]{6}|[0-9a-f]{3})(?![0-9a-f])/gi,
|
||||
|
||||
rgb: new RegExp(opaqueSpaceTpl
|
||||
.replace('_space_', 'rgb')
|
||||
.replace(/_[1-3]_/g, channels.eightBit.source), 'gi'),
|
||||
rgba: new RegExp(alphaSpaceTpl
|
||||
.replace('_space_', 'rgb')
|
||||
.replace(/_[1-3]_/g, channels.eightBit.source), 'gi'),
|
||||
|
||||
hsv: new RegExp(opaqueSpaceTpl
|
||||
.replace('_space_', 'hsv')
|
||||
.replace('_1_', channels.hue.source)
|
||||
.replace('_2_', channels.percentage.source)
|
||||
.replace('_3_', channels.percentage.source), 'gi'),
|
||||
hsva: new RegExp(alphaSpaceTpl
|
||||
.replace('_space_', 'hsv')
|
||||
.replace('_1_', channels.hue.source)
|
||||
.replace('_2_', channels.percentage.source)
|
||||
.replace('_3_', channels.percentage.source), 'gi'),
|
||||
|
||||
hsl: new RegExp(opaqueSpaceTpl
|
||||
.replace('_space_', 'hsl')
|
||||
.replace('_1_', channels.hue.source)
|
||||
.replace('_2_', channels.percentage.source)
|
||||
.replace('_3_', channels.percentage.source), 'gi'),
|
||||
hsla: new RegExp(alphaSpaceTpl
|
||||
.replace('_space_', 'hsl')
|
||||
.replace('_1_', channels.hue.source)
|
||||
.replace('_2_', channels.percentage.source)
|
||||
.replace('_3_', channels.percentage.source), 'gi'),
|
||||
|
||||
names: new RegExp('\\b(?:' + Object.keys(colorNames).join('|') + ')\\b', 'gi')
|
||||
};
|
||||
|
||||
spaces.all = new RegExp(Object.keys(spaces).map(function (space) {
|
||||
return spaces[space].source;
|
||||
}).join('|'), 'gi');
|
||||
|
||||
module.exports = spaces;
|
6
node_modules/synesthesia/lib/ranges.js
generated
vendored
Normal file
6
node_modules/synesthesia/lib/ranges.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
'1': /1|0/,
|
||||
'100': /100|(?:[1-9]?\d)/,
|
||||
'255': /255|(?:25[0-4]|2[0-4]\d|1\d\d|[1-9]?\d)/,
|
||||
'360': /360|(?:3[0-5]\d|[1-2]\d\d|[1-9]?\d)/
|
||||
};
|
102
node_modules/synesthesia/package.json
generated
vendored
Normal file
102
node_modules/synesthesia/package.json
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"synesthesia@^1.0.1",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/pipetteur"
|
||||
]
|
||||
],
|
||||
"_from": "synesthesia@>=1.0.1 <2.0.0",
|
||||
"_id": "synesthesia@1.0.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/synesthesia",
|
||||
"_nodeVersion": "4.4.1",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/synesthesia-1.0.1.tgz_1459603341285_0.7879380770027637"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "munter@fumle.dk",
|
||||
"name": "munter"
|
||||
},
|
||||
"_npmVersion": "2.14.20",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "synesthesia",
|
||||
"raw": "synesthesia@^1.0.1",
|
||||
"rawSpec": "^1.0.1",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.1 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/pipetteur"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/synesthesia/-/synesthesia-1.0.1.tgz",
|
||||
"_shasum": "5ef95ea548c0d5c6e6f9bb4b0d0731dff864a777",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "synesthesia@^1.0.1",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/pipetteur",
|
||||
"author": {
|
||||
"email": "munter@fumle.dk",
|
||||
"name": "Peter Müller"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Munter/synesthesia/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"css-color-names": "0.0.3"
|
||||
},
|
||||
"description": "A collection of regular expressions to match color syntax substrings from a text",
|
||||
"devDependencies": {
|
||||
"coveralls": "2.11.9",
|
||||
"istanbul": "0.4.2",
|
||||
"jshint": "2.9.1",
|
||||
"mocha": "2.4.5",
|
||||
"mocha-lcov-reporter": "1.2.0",
|
||||
"unexpected": "10.11.1"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dist": {
|
||||
"shasum": "5ef95ea548c0d5c6e6f9bb4b0d0731dff864a777",
|
||||
"tarball": "https://registry.npmjs.org/synesthesia/-/synesthesia-1.0.1.tgz"
|
||||
},
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"gitHead": "aa643e321fc6127a5c1da6f33f39d66bcaf66f37",
|
||||
"homepage": "https://github.com/Munter/synesthesia",
|
||||
"keywords": [
|
||||
"color",
|
||||
"css",
|
||||
"html",
|
||||
"match",
|
||||
"regex",
|
||||
"regexp",
|
||||
"substring",
|
||||
"syntax"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "munter",
|
||||
"email": "munter@fumle.dk"
|
||||
}
|
||||
],
|
||||
"name": "synesthesia",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Munter/synesthesia.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "jshint .",
|
||||
"test": "npm run lint && mocha",
|
||||
"travis": "npm run lint && istanbul cover _mocha"
|
||||
},
|
||||
"version": "1.0.1"
|
||||
}
|
Reference in New Issue
Block a user