🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@sillybit/colorhacks

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sillybit/colorhacks

A collection of color utility functions

latest
Source
npmnpm
Version
1.4.1
Version published
Maintainers
1
Created
Source

Colorhacks

npm package Build Status Downloads Issues Commitizen Friendly Semantic Release

Colorhacks is a collection of color conversion and manipulation utilities for TypeScript.

Install

npm

npm install @sillybit/colorhacks

yarn

yarn add @sillybit/colorhacks

pnpm

pnpm add @sillybit/colorhacks

bun

bun add @sillybit/colorhacks

Usage

import { getColorNameFromHex } from '@sillybit/colorhacks';

getColorNameFromHex('#FF0000');
// returns { hexcode: '#ff0000', colorName: 'Red', isExactMatch: true, shadeHex: '#ff0000', shadeName: 'Red', distance: 0 }
import { generateTheme } from '@sillybit/colorhacks';

generateTheme({
  baseColor: '#FF0000',
  expandPalette: true,
  colorScheme: 'complementary',
  infoHue: 200,
  successHue: 120,
  warningHue: 40,
  errorHue: 0,
});
// returns { brand: { ... }, primary: { ... }, secondary: { ... }, accent: { ... }, neutral: { ... }, info: { ... }, success: { ... }, warning: { ... }, error: { ... }, schemeColors: [ ... ] }

API

For more examples and API details, see the docs.

License

You can use this under the MIT license. See the LICENSE file for more details.

Contributing

We welcome contributions to this project. Please read our CONTRIBUTING.md file for more details.

Keywords

colorhack

FAQs

Package last updated on 29 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts