colormangle
Advanced tools
Comparing version
{ | ||
"name": "colormangle", | ||
"version": "0.1.95", | ||
"description": "converts html color strings to various format", | ||
"main": "colormangle.min.js", | ||
"version": "0.1.96", | ||
"description": "ColorMangle creates colorscheme, converts color strings to various format and calculates appropriate text color based on contrast ratio.", | ||
"main": "src/colormangle.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "node node_modules/basic-node-server/index.js 3300" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/broadwayinc/colormangle.git" | ||
"url": "git+https://github.com/broadwayinc/colormangle.git" | ||
}, | ||
"keywords": [ | ||
"colormangle" | ||
], | ||
"author": "Baksa Gimm", | ||
"author": "", | ||
"license": "MIT", | ||
@@ -21,3 +18,6 @@ "bugs": { | ||
}, | ||
"homepage": "https://github.com/broadwayinc/colormangle#readme" | ||
"homepage": "https://github.com/broadwayinc/colormangle#readme", | ||
"dependencies": { | ||
"basic-node-server": "^1.0.4" | ||
} | ||
} |
@@ -1,15 +0,15 @@ | ||
<img alt="APM" src="https://img.shields.io/apm/l/vim-mode"> | ||
# ColorMangle | ||
# ColorMangle <br /> | ||
**ColorMangle** converts color strings to various format and calculates appropriate text color based on contrast ratio. | ||
[Getting started](#getting-started) | [ColorMangle()](#new-ColorMangle) | [.hex()](#hex) | [.rgba()](#rgba) | [.hsla()](#hsla) | [.contrastRatio()](#contrastRatio) | [.textColor()](#textColor) | [License](#license) </br> | ||
## Getting started | ||
**ColorMangle** converts color strings to various format and calculates appropriate text color based on contrast ratio. | ||
<br /> | ||
## Getting started | ||
Add script tag in your header | ||
``` | ||
<script src="https://broadwayinc.dev/jslib/colormangle/0.1.95/colormangle.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/colormangle@latest/colormangle.js"></script> | ||
``` | ||
And in your javascript: | ||
``` | ||
@@ -20,3 +20,3 @@ let colormangle = new ColorMangle('rgb(0, 0, 255)'); | ||
``` | ||
<br /> | ||
On node.js or webpack based projects | ||
@@ -27,7 +27,8 @@ | ||
``` | ||
And in your javascript: | ||
``` | ||
import {ColorMangle} from 'colormangle'; | ||
import ColorMangle from 'colormangle'; | ||
``` | ||
<br /> | ||
@@ -48,4 +49,2 @@ ## Basic usage | ||
<br /> | ||
### .hex() | ||
@@ -62,9 +61,8 @@ | ||
<br /> | ||
### .rgba(<number: opacity. 0~1 range>) | ||
**.rgba()** converts any color format string to **rgba** format. The input argument 'opacity' is to set the opacity value of the rgba output. Without any argument, the default value is 1 (0 as fully transparent and 1 as fully opaque). | ||
<br />**.rgba()** returns object properties (r, g, b, a, string and their values) as in the following structure. | ||
**.rgba()** returns object properties (r, g, b, a, string and their values) as in the following structure. | ||
``` | ||
@@ -90,4 +88,2 @@ { | ||
<br /> | ||
### .hsla(<number: opacity 0~1 range>) | ||
@@ -109,2 +105,3 @@ | ||
``` | ||
**_Example 3_** | ||
@@ -128,5 +125,5 @@ | ||
``` | ||
<br /> | ||
### .contrastRatio(<string: html color>) | ||
**.contrastRatio()** calculates the contrast ratio between the given colors. | ||
@@ -139,3 +136,2 @@ | ||
``` | ||
<br /> | ||
@@ -142,0 +138,0 @@ ### .textColor(<number: opacity. 0~1 range>) |
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 contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
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
56436
141.45%6
100%1098
1491.3%1
-50%1
Infinity%1
Infinity%163
-2.4%1
Infinity%+ Added
+ Added