generate-random-gradient

1.0.2 • Public • Published

random-gradient-generator 🎨

Generate beautiful linear gradients with randomly generated hex values.

gradient-random

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with 💛 by Nazneen Oomatia (GitHub).


Package Sidebar

Install

npm i generate-random-gradient

Weekly Downloads

8

Version

1.0.2

License

MIT

Unpacked Size

5.25 kB

Total Files

5

Last publish

Collaborators

  • naz_chini