@jiaminghi/color
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -0,1 +1,7 @@ | ||
# 0.0.2-alpha (2019-04-08) | ||
### Publish | ||
* **version:** V 0.0.2-alpha | ||
# 0.0.1-alpha (2019-04-04) | ||
@@ -2,0 +8,0 @@ |
33
index.js
@@ -10,3 +10,3 @@ const hexReg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/ | ||
*/ | ||
function getRgbValue (color) { | ||
export function getRgbValue (color) { | ||
if (!color) { | ||
@@ -67,3 +67,3 @@ console.error('Missing parameters!') | ||
*/ | ||
function toRgb (color, opacity) { | ||
export function toRgb (color, opacity) { | ||
if (!color) { | ||
@@ -89,3 +89,3 @@ console.error('Missing parameters!') | ||
*/ | ||
function toHex (color) { | ||
export function toHex (color) { | ||
if (!color) { | ||
@@ -120,3 +120,3 @@ console.error('Missing parameters!') | ||
*/ | ||
function getOpacity (color) { | ||
export function getOpacity (color) { | ||
if (!color) { | ||
@@ -142,3 +142,3 @@ console.error('Missing parameters!') | ||
*/ | ||
function getRgbaValue (color) { | ||
export function getRgbaValue (color) { | ||
if (!color) { | ||
@@ -157,3 +157,8 @@ console.error('Missing parameters!') | ||
function getColorFromRgbValue (value) { | ||
/** | ||
* @description Get Color from rgb value | ||
* @param {Array} value Rgb color value | ||
* @return {String} Rgb / rgba color | ||
*/ | ||
export function getColorFromRgbValue (value) { | ||
if (!value) { | ||
@@ -180,3 +185,9 @@ console.error('Missing parameters!') | ||
function darken (color, percent) { | ||
/** | ||
* @description Deepen color | ||
* @param {String} color Hex or rgb/rgba color | ||
* @return {Number} Percent of Deepen | ||
* @return {String} Rgba color | ||
*/ | ||
export function darken (color, percent) { | ||
if (!color) { | ||
@@ -199,3 +210,9 @@ console.error('Missing parameters!') | ||
function lighten (color, percent) { | ||
/** | ||
* @description Brighten color | ||
* @param {String} color Hex or rgb/rgba color | ||
* @return {Number} Percent of brighten | ||
* @return {String} Rgba color | ||
*/ | ||
export function lighten (color, percent) { | ||
if (!color) { | ||
@@ -202,0 +219,0 @@ console.error('Missing parameters!') |
{ | ||
"name": "@jiaminghi/color", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "JiaMing <743192023@qq.com>", | ||
@@ -5,0 +5,0 @@ "description": "Color extension", |
@@ -130,3 +130,3 @@ <h1 align="center">Color Extension</h1> | ||
### toHex | ||
#### toHex | ||
@@ -260,2 +260,2 @@ ```javascript | ||
// color2 = 'rgba(48,128,232,0.2)' | ||
``` | ||
``` |
18688
177
260