Socket
Socket
Sign inDemoInstall

@jiaminghi/color

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jiaminghi/color - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# 0.0.3-alpha (2019-04-30)
### Bug Fixes
* **getOpacity:** Abnormal calculation due to spaces.
# 0.0.2-alpha (2019-04-08)

@@ -2,0 +8,0 @@

36

index.js

@@ -6,3 +6,3 @@ const hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/

/**
* @description Get the rgb value of the color
* @description Get the rgb value of the color
* @param {String} color Hex or rgb/rgba color

@@ -34,3 +34,3 @@ * @return {Array} Rgb value of the color

/**
* @description Get the rgb value of the hex color
* @description Get the rgb value of the hex color
* @param {String} color Hex color

@@ -50,3 +50,3 @@ * @return {Array} Rgb value of the color

/**
* @description Get the rgb value of the rgb/rgba color
* @description Get the rgb value of the rgb/rgba color
* @param {String} color Hex color

@@ -64,5 +64,5 @@ * @return {Array} Rgb value of the color

/**
* @description Convert color to rgb/rgba color
* @param {String} color Hex or rgb/rgba color
* @param {Number} opacity The opacity of color
* @description Convert color to rgb/rgba color
* @param {String} color Hex or rgb/rgba color
* @param {Number} opacity The opacity of color
* @return {String} Rgb/rgba color

@@ -87,4 +87,4 @@ */

/**
* @description Convert color to hex color
* @param {String} color Hex or rgb/rgba color
* @description Convert color to hex color
* @param {String} color Hex or rgb/rgba color
* @return {String} Hex color

@@ -118,4 +118,4 @@ */

/**
* @description Get the opacity of color
* @param {String} color Hex or rgb/rgba color
* @description Get the opacity of color
* @param {String} color Hex or rgb/rgba color
* @return {Number} Color opacity

@@ -136,7 +136,7 @@ */

return Number(color.replace(/^(rgba\()|(\d+,){3}|(\))/g, ''))
return Number(color.replace(/^(rgba\()|(\s*\d+\s*,){3}|(\))/g, ''))
}
/**
* @description Get the rgba value of the color
* @description Get the rgba value of the color
* @param {String} color Hex or rgb/rgba color

@@ -160,4 +160,4 @@ * @return {Array} Rgba value of the color

/**
* @description Get Color from rgb value
* @param {Array} value Rgb color value
* @description Get Color from rgb value
* @param {Array} value Rgb color value
* @return {String} Rgb / rgba color

@@ -188,4 +188,4 @@ */

/**
* @description Deepen color
* @param {String} color Hex or rgb/rgba color
* @description Deepen color
* @param {String} color Hex or rgb/rgba color
* @return {Number} Percent of Deepen

@@ -213,4 +213,4 @@ * @return {String} Rgba color

/**
* @description Brighten color
* @param {String} color Hex or rgb/rgba color
* @description Brighten color
* @param {String} color Hex or rgb/rgba color
* @return {Number} Percent of brighten

@@ -217,0 +217,0 @@ * @return {String} Rgba color

{
"name": "@jiaminghi/color",
"version": "0.0.2",
"version": "0.0.3",
"author": "JiaMing <743192023@qq.com>",

@@ -5,0 +5,0 @@ "description": "Color extension",

@@ -11,35 +11,35 @@ <h1 align="center">Color Extension</h1>

Deepen color
Deepen color.
- **[lighten](#lighten)**
Brighten color
Brighten color.
- **[fade](#fade)**
Adjust color opacity
Adjust color opacity.
- **[toHex](#toHex)**
Convert color to hex color
Convert color to hex color.
- **[toRgb](#toRgb)**
Convert color to rgb/rgba color
Convert color to rgb/rgba color.
- **[getOpacity](#getOpacity)**
Get color opacity
Get color opacity.
- **[getRgbValue](#getRgbValue)**
Get the color rgb value
Get the color rgb value.
- **[getRgbaValue](#getRgbaValue)**
Get the color rgba value
Get the color rgba value.
- **[getColorFromRgbValue](#getColorFromRgbValue)**
Get Color from rgb value
Get Color from rgb value.

@@ -49,3 +49,3 @@ ### Install with npm

```shell
npm install @jiaminghi/color
$ npm install @jiaminghi/color
```

@@ -61,4 +61,4 @@

/**
* @description Deepen color
* @param {String} color Hex or rgb/rgba color
* @description Deepen color
* @param {String} color Hex or rgb/rgba color
* @return {Number} Percent of Deepen

@@ -87,4 +87,4 @@ * @return {String} Rgba color

/**
* @description Brighten color
* @param {String} color Hex or rgb/rgba color
* @description Brighten color
* @param {String} color Hex or rgb/rgba color
* @return {Number} Percent of brighten

@@ -113,5 +113,5 @@ * @return {String} Rgba color

/**
* @description Adjust color opacity
* @param {String} color Hex or rgb/rgba color
* @return {Number} Percent of opacity
* @description Adjust color opacity
* @param {String} color Hex or rgb/rgba color
* @param {Number} Percent of opacity
* @return {String} Rgba color

@@ -139,4 +139,4 @@ */

/**
* @description Convert color to hex color
* @param {String} color Hex or rgb/rgba color
* @description Convert color to hex color
* @param {String} color Hex or rgb/rgba color
* @return {String} Hex color

@@ -160,5 +160,5 @@ */

/**
* @description Convert color to rgb/rgba color
* @param {String} color Hex or rgb/rgba color
* @param {Number} opacity The opacity of color
* @description Convert color to rgb/rgba color
* @param {String} color Hex or rgb/rgba color
* @param {Number} opacity The opacity of color
* @return {String} Rgb/rgba color

@@ -184,4 +184,4 @@ */

/**
* @description Get the opacity of the color
* @param {String} color Hex or rgb/rgba color
* @description Get the opacity of the color
* @param {String} color Hex or rgb/rgba color
* @return {Number} Color opacity

@@ -209,3 +209,3 @@ */

/**
* @description Get the color rgb value
* @description Get the color rgb value
* @param {String} color Hex or rgb/rgba color

@@ -230,3 +230,3 @@ * @return {Array} Rgb value of the color

/**
* @description Get the color rgba value
* @description Get the color rgba value
* @param {String} color Hex or rgb/rgba color

@@ -254,4 +254,4 @@ * @return {Array} Rgba value of the color

/**
* @description Get Color from rgb value
* @param {Array} value Rgb color value
* @description Get Color from rgb value
* @param {Array} value Rgb color value
* @return {String} Rgb / rgba color

@@ -258,0 +258,0 @@ */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc