Socket
Socket
Sign inDemoInstall

lolcolor

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lolcolor

Turn anything into a color!


Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
Source

lolcolor

Turn anything into a color!

Install

If you are using lolcolor in javascript code, a simple install will add it to your dependencies.

npm install lolcolor

If this is getting bundled into front-end javascript, you might want to install into your devDependencies instead.

npm install -D lolcolor

If requiring easy use via command-line, install globally.

npm install -g lolcolor

If not running often, consider using npx instead of a global install.

npx lolcolor "Hey now, you're an all star"

Usage

Command Line

lolcolor can be used from the command line.

lolcolor "get your game on, go play"

Function

The simplest way to use lolcolor in code is as a simple function.


const lolcolor = require('lolcolor');

const text = 'Hey now, you\'re a rock star';

console.log(lolcolor(text));

ColorBuilder

If you need a bit more control over your colors you can use the ColorBuilder.


const { ColorBuilder } = require('lolcolor');

const builderText = 'get the show on, get paid';

const colorBuilder = new ColorBuilder();

const [colorR, colorG, colorB] = colorBuilder.fromString(builderText).asRgb().butOnly64Colors().create();

console.log(`Red value:${colorR}, Green value:${colorG}, Blue value:${colorB}`);

CategoryMethodParametersDescription
BeginfromStringsourceThe input text
Createcreate(none)Output your color
Color modeasHex(none)Use hex color mode
Color modeasHsl(none)Use HSL color mode
Color modeasRgb(none)Use RGB color mode
Color limitbutOnly8Colors(none)Only choose from 8 colors
Color limitbutOnly64Colors(none)Only choose from 64 colors (6-bit)
Color limitbutOnly256Colors(none)Only choose from 256 colors

FAQs

Package last updated on 31 Jan 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc