1.0.3 • Published 4 years ago

@silen/rgba v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

rgba

Determine the expression is rgba color

install

npm i @silen/rgba

usage

const { isRgba } = require('@silen/rgba');
// or
import { isRgba } from '@silen/rgba';

console.log(isRgb('your expression'));

isRgba('          rgba( 123 , 12 , 1, 1)    ');       // true
isRgba('          rgba( 123 , 12 , 1, 1%)    ');      // true
isRgba('          rgba( 123 , 12% , 1, 1%)    ');     // false
isRgba('          rgba( 123 , 12% , 1%, 1%)    ');    // false
isRgba('          rgba( 123% , 12% , 1%, 1%)    ');   //true
isRgba('          rgba( 123% , 12% , 1%, 1)    ');    // true

// or
console.log(window.Rgba.isRgba(''));