with-alpha-hex
Advanced tools
Comparing version 1.0.2 to 1.0.3
/** | ||
* adds given alpha value to a css hex color. | ||
* change/add alpha(opacity) of a css hexadecimal color. | ||
* | ||
@@ -4,0 +4,0 @@ * @example |
@@ -9,3 +9,3 @@ "use strict"; | ||
/** | ||
* adds given alpha value to a css hex color. | ||
* change/add alpha(opacity) of a css hexadecimal color. | ||
* | ||
@@ -12,0 +12,0 @@ * @example |
{ | ||
"name": "with-alpha-hex", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A tiny TypeScript/JavaScript library which helps change/add alpha(opacity) of a css hexadecimal color.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -10,2 +10,6 @@ # with-alpha-hex | ||
## Installation | ||
`npm i with-alpha-hex` or `yarn add with-alpha-hex` | ||
## Helps what? / Why / When to use / Features | ||
@@ -18,5 +22,5 @@ | ||
## Installation | ||
## A 8-digit css hexadecimal color sample | ||
`npm i with-alpha-hex` or `yarn add with-alpha-hex` | ||
![alpha-sample](https://user-images.githubusercontent.com/46079709/95020082-ee288180-06a3-11eb-822c-eab34d01d5be.png) | ||
@@ -30,8 +34,11 @@ ## Usage | ||
const weakTextColor = withAlphaHex(textColor, 0.4) | ||
const weakTextColor = withAlphaHex(textColor, 0.4) // #00000066 | ||
console.log(weakTextColor) // #00000066 | ||
const primaryColor = '#14B1AB' | ||
const weakPrimaryColor = withAlphaHex(primaryColor, 0.2) // #14B1AB33 | ||
``` | ||
## Styled-JSX Example | ||
```tsx | ||
@@ -38,0 +45,0 @@ import { withAlphaHex } from 'with-alpha-hex' |
9082
68