npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@edaru/color-palette-generator

v0.2.1

Published

color palette generator

Downloads

30

Readme

@edaru/color-palette-generator

A powerful and easy-to-use TailwindCSS like color palette generator.

Features

  • Generate custom color palettes based on a single hex color code
  • Seamlessly integrate with TailwindCSS projects
  • Create harmonious color schemes

Installation

Install the package using your preferred package manager:

npm install @edaru/color-palette-generator
# or
yarn add @edaru/color-palette-generator
# or
pnpm install @edaru/color-palette-generator

Usage

Import the generateCustomPalette function and use it with your desired color:

import { generateCustomPalette } from '@edaru/color-palette-generator'

const baseColor = '#123456'
const customPalette = generateCustomPalette(baseColor)

console.log(customPalette)

The generateCustomPalette function returns an object with color variations from 50 to 950, following the TailwindCSS naming convention.

Integration with TailwindCSS

To use your generated palette in a TailwindCSS project, add it to your tailwind.config.js file:

tailwind.config.js

import { generateCustomPalette } from '@edaru/color-palette-generator'

export default {
  theme: {
    extend: {
      colors: {
        custom: generateCustomPalette('#123456').shades,
      },
    },
  },
  // ... other configurations
}

tailwind.config.cjs

const { generateCustomPalette } = require('@edaru/color-palette-generator')

module.exports = {
  theme: {
    extend: {
      colors: {
        custom: generateCustomPalette('#123456').shades,
      },
    },
  },
  // ... other configurations
}

Now you can use your custom colors in your project, like bg-custom-500 or text-custom-200.

API Reference

generateCustomPalette(baseColor: string): object

Generates a color palette based on the provided base color.

  • baseColor: A string representing a valid hex color code (e.g., "#123456")
  • Returns: An object with color variations from 50 to 950

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.