rDrama/node_modules/is-color-stop
Aevann1 67a1595b9b fdsfd 2021-12-13 22:28:32 +00:00
..
lib fdsfd 2021-12-13 22:28:32 +00:00
test fdsfd 2021-12-13 22:28:32 +00:00
util fdsfd 2021-12-13 22:28:32 +00:00
.eslintrc fdsfd 2021-12-13 22:28:32 +00:00
.npmignore fdsfd 2021-12-13 22:28:32 +00:00
.travis.yml fdsfd 2021-12-13 22:28:32 +00:00
HISTORY.md fdsfd 2021-12-13 22:28:32 +00:00
LICENSE fdsfd 2021-12-13 22:28:32 +00:00
README.md fdsfd 2021-12-13 22:28:32 +00:00
index.js fdsfd 2021-12-13 22:28:32 +00:00
package.json fdsfd 2021-12-13 22:28:32 +00:00

README.md

is-color-stop

Check if a string is CSS color stop

NPM version Build Status Coverage Status NPM downloads Dependency Status

Install

$ npm install is-color-stop

Usage

const isColorStop = require('is-color-stop');

isColorStop('yellow') // true
isColorStop('yellow', '12px') // true
isColorStop('yellow', 'calc(100%)') // true
isColorStop('yellow', 'px') // false

isColorStop.isColor('red') // true
isColorStop.isColor('rgb(255)') // false

isColorStop.isRGB('rgb(255, 0, 0)') // true
isColorStop.isRGB('rgb(255)') // false

isColorStop.isRGBA('rgba(255, 0, 0, .8)') // true
isColorStop.isRGBA('rgba(255, 0, 0)') // false

isColorStop.isHSL('hsl(123, 45%, 67%)') // true
isColorStop.isHSL('hsl(123, 45%)') // false

isColorStop.isHSLA('hsla(123, 45%, 67%, 0.4)') // true
isColorStop.isHSLA('hsla(123, 45%, 67%)') // false

isColorStop.isHex('#fff') // true
isColorStop.isHex('#ff') // false

isColorStop.isCSSColorName('tomato') // true
isColorStop.isCSSColorName('hoge') // false

isColorStop.isCSSLengthUnit('px') // true
isColorStop.isCSSLengthUnit('x') // false

isColorStop.isTransparent('transparent') // true

License

The MIT License (MIT)

Copyright (c) 2017 Pigcan