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

@tiger-ui/color-palette-generator

v2.0.2

Published

Install the package in your project directory with: ### npm: ``` npm install @tiger-ui/color-palette-generator ``` ### yarn: ``` yarn add @tiger-ui/color-palette-generator ```

Downloads

18

Readme

Color Palette Generator is a handy package that creates dark, light and contrasting colors for your colors. You can also change the intensity of your dark and light colors as you wish.

Installation

Install the package in your project directory with:

npm:

npm install @tiger-ui/color-palette-generator

yarn:

yarn add @tiger-ui/color-palette-generator

Examples

Let's make an example on a React project:

import { Color } from '@tiger-ui/color-palette-generator';

import Box from '../../components/Box';
import Paragraph from '../../components/Paragraph';

export default function MyComponent() {
   const myColors = new Color('#1746d1');

    console.log('main color: ', myColors.main);
    console.log('dark color: ', myColors.dark);
    console.log('light color: ', myColors.light);
    console.log('contrast color: ', myColors.contrast);

    return (
      <Box display="flex" width="100%" justifyContent="center" my={10}>
        <Box
          width="200px"
          height="200px"
          display="flex"
          alignItems="center"
          justifyContent="center"
          bgColor={myColors.dark}
        >
          <Paragraph color={myColors.contrast}>Darker</Paragraph>
        </Box>
        <Box
          width="200px"
          height="200px"
          display="flex"
          alignItems="center"
          justifyContent="center"
          bgColor={myColors.main}
        >
          <Paragraph color={myColors.contrast}>Main</Paragraph>
        </Box>
        <Box
          width="200px"
          height="200px"
          display="flex"
          alignItems="center"
          justifyContent="center"
          bgColor={myColors.light}
        >
          <Paragraph color={myColors.contrast}>Light</Paragraph>
        </Box>
      </Box>
    );
}

output:

image

main color:  #1746d1
dark color:  #1541c3
light color:  #184adf
contrast color:  #ffffff

You can change the intensity of the dark and light colors. You can also customize the Contrast color:

import { Color } from '@tiger-ui/color-palette-generator';

import Box from '../../components/Box';
import Paragraph from '../../components/Paragraph';

export default function MyComponent() {
    const myColors = new Color(
      '#1746d1',
      {
        darkColorIntensity: 10, // default: 3 (%3)
        lightColorIntensity: 10, // default: 3 (%3)
        contrastDarkValue: '#000a26',
        contrastLightValue: '#c4d3ff',
      },
    );

    console.log('main color: ', myColors.main);
    console.log('dark color: ', myColors.dark);
    console.log('light color: ', myColors.light);
    console.log('contrast color: ', myColors.contrast);

    return (
      <Box display="flex" width="100%" justifyContent="center" my={10}>
        <Box display="flex" key={myColors.main}>
          <Box
            width="200px"
            height="200px"
            display="flex"
            alignItems="center"
            justifyContent="center"
            bgColor={myColors.dark}
          >
            <Paragraph color={myColors.contrast}>Darker</Paragraph>
          </Box>
          <Box
            width="200px"
            height="200px"
            display="flex"
            alignItems="center"
            justifyContent="center"
            bgColor={myColors.main}
          >
            <Paragraph color={myColors.contrast}>Main</Paragraph>
          </Box>
          <Box
            width="200px"
            height="200px"
            display="flex"
            alignItems="center"
            justifyContent="center"
            bgColor={myColors.light}
          >
            <Paragraph color={myColors.contrast}>Light</Paragraph>
          </Box>
        </Box>
      </Box>
    );
}

output:

image2

main color:  #1746d1
dark color:  #1236a3
light color:  #3360e9
contrast color:  #c4d3ff

More Examples

import { Color } from '@tiger-ui/color-palette-generator';

import Box from '../../components/Box';
import Paragraph from '../../components/Paragraph';

export default function MyComponent() {
    const myColors = [
      new Color('#1746d1'), // blue
      new Color('#d11717'), // red
      new Color('#d1cb17'), // yellow
      new Color('#17d136'), // green
    ]

    return (
      <Box display="flex" justifyContent="center">
        <Box my={10}>
          {myColors.map((color) => (
            <Box display="flex" key={color.main}>
              <Box
                width="200px"
                height="200px"
                display="flex"
                alignItems="center"
                justifyContent="center"
                bgColor={color.dark}
              >
                <Paragraph color={color.contrast}>Darker</Paragraph>
              </Box>
              <Box
                width="200px"
                height="200px"
                display="flex"
                alignItems="center"
                justifyContent="center"
                bgColor={color.main}
              >
                <Paragraph color={color.contrast}>Main</Paragraph>
              </Box>
              <Box
                width="200px"
                height="200px"
                display="flex"
                alignItems="center"
                justifyContent="center"
                bgColor={color.light}
              >
                <Paragraph color={color.contrast}>Light</Paragraph>
              </Box>
            </Box>
          ))}
        </Box>
      </Box>
    );
}

output:

image3