UNPKG

639 BMarkdownView Raw
1# `hero-patterns.js`
2
3Easily set background images from [Hero Patterns](http://heropatterns.com) with JavaScript.
4
5Each pattern from [Hero Patterns](http://heropatterns.com) has its own function. Each function returns the SVG data as a string wrapped in a `url()` function. The functions take two parameters: one for setting the fill color, the other for setting the fill opacity.
6
7# Usage
8
9### Install
10
11```js
12npm install --save hero-patterns
13```
14
15### Set `background-image` to "Tic Tac Toe" pattern
16
17```js
18import {ticTacToe} from 'hero-patterns'
19
20let el = document.querySelector('header')
21el.style.backgroundImage = ticTacToe('red', 0.9)
22
\No newline at end of file