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

color-repo-kim

v2.1.2

Published

A lightweight JavaScript library for casual color manipulation

Downloads

10

Readme

*IMPORTANT: If you're using v1.0.0 of color-repo-kim in an ES6 environment and encountering the 'Cannot use import outside a module' error, please run npm install color-repo-kim@latest to resolve the issue and install the latest version (v2.0.0).

Color Repo Kim

this readme is still a work in progress. Some info might be out of place

Color Repo is a lightweight JavaScript library for seamless color manipulation and analysis. It provides a collection of methods to manipulate, analyze, and convert colors easily.

Installation

npm install color-repo-kim

or using cdn.jsdelivr.:

https://cdn.jsdelivr.net/npm/[email protected]

Usage

Basic Example

const { ColorRepoKim } = require('color-repo-kim');

// Define a sample color
const sampleColor = { r: 255, g: 0, b: 0 };

// Get the complementary color
const complementaryColor = ColorRepoKim.manipulate.getComplementaryColor(sampleColor);

// Display results
console.log('Sample Color:', sampleColor);
console.log('Complementary Color:', complementaryColor);`

Expected output:

Sample Color: { r: 255, g: 0, b: 0 }
Complementary Color: { r: 0, g: 255, b: 255 }`

Advanced Features

ColorRepoKim includes a variety of color manipulation features:

  • Get Split Complementary Colors
const splitComplementaryColors = ColorRepoKim.manipulate.getSplitComplementaryColors(sampleColor);
console.log('Split Complementary Colors:', splitComplementaryColors);`
  • Get Analogous Colors
const analogousColors = ColorRepoKim.manipulate.getAnalogousColors(sampleColor);
console.log('Analogous Colors:', analogousColors);`
  • Get Monochromatic Colors

  const monochromaticColors = ColorRepoKim.manipulate.getMonochromaticColors(sampleColor, 5);
  console.log('Monochromatic Colors:', monochromaticColors);`
  • Additional Color Manipulation Methods
    ColorRepoKim provides more advanced color manipulation methods:

    • Triadic Colors
    • Tetradic Colors
    • Lighten Color
    • Darken Color
    • Invert Color

    Explore these methods in the API Documentation.

API Documentation

For detailed information on all available methods and their parameters, refer to the API Documentation.

Examples

React Component

  import {ColorRepoKim} from 'color-repo-kim'


  export const Component = (props) => {
      const { baseColor } = props;

      const [currentColor, setCurrentColor] = useState(ColorRepoKim.convert.hslToHex(baseColor));
    
      return (
          <article className={`...other bg-${currentColor}-500`}>
            <button>click me</button>
          </article>
    )
  }

Contributing

If you have ideas for new features, improvements, or find any issues, feel free to contribute by opening an issue or a pull request.

License

This library is licensed under the MIT License - see the file for details. LICENSEThis expanded README includes sections for API Documentation, Examples, and a basic React Component.