2026.0.0 • Published 5 months ago

@f0c1s/random-colored-string v2026.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 months ago

random-colored-string

Random colored string in terminal

Features

  • colored(str): Returns the input string in a random color (both regular and soft variants)
  • allColored(str): Returns an array of the input string in all available colors
  • Regular colors: black, blue, cyan, green, magenta, red, white, yellow
  • Soft colors: blackSoft, blueSoft, cyanSoft, greenSoft, magentaSoft, redSoft, whiteSoft, yellowSoft

Related projects

NameNPM packageGitHub repo
color-blacknpmgithub
color-bluenpmgithub
color-cyannpmgithub
color-greennpmgithub
color-magentanpmgithub
color-rednpmgithub
color-whitenpmgithub
color-yellownpmgithub
random-colored-stringnpmgithub

Usage

import colored, { allColored } from "random-colored-string";

// Get string in a random color
console.log(colored("Hello, World!"));

// Get string in all available colors
console.log(allColored("Hello, World!"));

// Use specific colors
import { red, redSoft } from "random-colored-string";
console.log(red("Error!"));
console.log(redSoft("Warning..."));

References

License

MIT License

Copyright (c) 2019-2025 Anubhav Saini