New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

colormangle

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colormangle - npm Package Compare versions

Comparing version

to
0.1.96

colormangle.js

20

package.json
{
"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>)