🎨
random-gradient-generator Generate beautiful linear gradients with randomly generated hex values.
No dependencies!
Installation
npm install --save generate-random-gradient
Usage
const gradient = require("generate-random-gradient");
gradient(); // => 'linear-gradient(29deg, #a2075c, #a0e60e)'
gradient(); // => 'linear-gradient(256deg, #9783fd, #e3b03e)'
Usage in Vue (in app.vue for example):
<script setup>
import gradient from "generate-random-gradient"; function applyGradient(e) {
e.target.style.background = gradient();
}
</script>
<template>
<div id="app">
<button @click="applyGradient">Hello!</button>
</div>
</template>
License
MIT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted with