colormangle
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "colormangle", | ||
"version": "0.1.2", | ||
"description": "converts html color strings to various format", | ||
"main": "colormangle.min.js", | ||
"version": "0.1.3", | ||
"description": "", | ||
"main": "colormangle.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"prod": "webpack -- --env mode=production" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/broadwayinc/colormangle.git" | ||
}, | ||
"keywords": [ | ||
"colormangle" | ||
], | ||
"keywords": [], | ||
"author": "Baksa Gimm", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/broadwayinc/colormangle/issues" | ||
"devDependencies": { | ||
"@babel/core": "^7.13.8", | ||
"@babel/preset-env": "^7.13.9", | ||
"babel-loader": "^8.2.2", | ||
"webpack": "^5.24.2", | ||
"webpack-cli": "^4.5.0" | ||
}, | ||
"homepage": "https://github.com/broadwayinc/colormangle#readme" | ||
"dependencies": { | ||
"babel-polyfill": "^6.26.0" | ||
} | ||
} |
@@ -1,6 +0,8 @@ | ||
<img alt="APM" src="https://img.shields.io/apm/l/vim-mode"> [![Github All Releases](https://img.shields.io/github/downloads/broadwayinc/colormangle/total.svg)]() | ||
<img alt="APM" src="https://img.shields.io/apm/l/vim-mode"> | ||
# ColorMangle | ||
**ColorMangle** converts color strings to various format, | ||
calculates appropriate text color based on contrast ratio. | ||
# ColorMangle <br /> | ||
[Getting started](#getting-started) | [ColorMangle()](#new-ColorMangle) | [.hex()](#hex) | [.rgba()](#rgba) | [.hsla()](#hsla) | [.contrastRatio()](#contrastRatio) | [.textColor()](#textColor) | [License](#license) </br> | ||
**ColorMangle** converts color strings to various format and calculates appropriate text color based on contrast ratio. | ||
<br /> | ||
@@ -19,6 +21,16 @@ ## Getting started | ||
<br /> | ||
On node.js or webpack based projects | ||
``` | ||
npm i colormangle | ||
``` | ||
And in your javascript: | ||
``` | ||
import {ColorMangle} from 'colormangle'; | ||
``` | ||
<br /> | ||
## Basic usage | ||
### new ColorMangle() | ||
### ColorMangle() | ||
@@ -41,3 +53,3 @@ **ColorMangle** input argument string can be either colorname string or any type of HTML color codes (hex, rgb, hsl). | ||
**_Example_** | ||
**_Example 1_** | ||
@@ -66,3 +78,3 @@ ``` | ||
**_Example_** | ||
**_Example 2_** | ||
@@ -95,3 +107,3 @@ ``` | ||
``` | ||
**_Example_** | ||
**_Example 3_** | ||
@@ -116,2 +128,12 @@ ``` | ||
### .contrastRatio() | ||
**.contrastRatio()** calculates the contrast ratio between the given colors. | ||
**_Example 4_** | ||
``` | ||
new ColorMangle('red').contrastRatio('white') | ||
// returns 3.9984767707539985 | ||
``` | ||
<br /> | ||
### .textColor() | ||
@@ -121,7 +143,7 @@ | ||
**_Example 1_** | ||
**_Example 5_** | ||
``` | ||
new ColorMangle('blue').textColor() | ||
// returns hex format text color '#ffffff'. | ||
// returns hex format text color '#ffffff' | ||
// white (#ffffff)' is the recommended output text color to be used on blue background. | ||
@@ -135,3 +157,3 @@ | ||
**_Example 2_** | ||
**_Example 6_** | ||
@@ -138,0 +160,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
34065
6
689
167
1
5
1
1
1
+ Addedbabel-polyfill@^6.26.0
+ Addedbabel-polyfill@6.26.0(transitive)
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedregenerator-runtime@0.10.50.11.1(transitive)