这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ Supports 3-, 4-, 6- and 8-digit hex values with or without a leading hash.
```sh
$ npm install --save hex-to-rgba
```
or
```sh
$ yarn add hex-to-rgba
```

## Usage
```js
var hexToRgba = require("hex-to-rgba");
import hexToRgba from 'hex-to-rgba';

// Or if you're so inclined:
// var hexToRgba = require("hex-to-rgba");

hexToRgba('112233'); // "rgba(17, 34, 51, 1)"
hexToRgba('#112233'); // "rgba(17, 34, 51, 1)"
Expand All @@ -40,7 +47,7 @@ hexToRgba('#1234', 0.75) // "rgba(17, 34, 51, 0.75)"

Testing
```
npm run build && npm test
yarn build && yarn test
```

## Signature
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"build": "babel src -d build",
"lint": "eslint src",
"mocha": "mocha --compilers js:babel-core/register",
"prepublish": "npm run build && npm test",
"test": "npm run lint && npm run mocha"
"prepublish": "yarn build && yarn test",
"test": "yarn lint && yarn mocha"
},
"repository": {
"type": "git",
Expand Down
Loading