All Projects → luoxiu → Chalk

luoxiu / Chalk

Licence: MIT license
✏️Expressive styling on terminal string. (chalk for swift)

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Chalk

ansi-to-svg
😹 convert ANSI Escaped CLI strings to SVGs
Stars: ✭ 18 (-69.49%)
Mutual labels:  color, chalk
yachalk
🖍️ Terminal string styling done right
Stars: ✭ 131 (+122.03%)
Mutual labels:  color, chalk
Chalk
🖍 Terminal string styling done right
Stars: ✭ 17,566 (+29672.88%)
Mutual labels:  color, chalk
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (-59.32%)
Mutual labels:  color, chalk
ink-color-pipe
🌈 Create color text with simpler style strings in Ink
Stars: ✭ 18 (-69.49%)
Mutual labels:  color, chalk
chalk
🖍️🎨Composable and simple terminal highlighting package for OCaml.
Stars: ✭ 29 (-50.85%)
Mutual labels:  color, chalk
Chalk Animation
🎬 Colorful animations in terminal output
Stars: ✭ 1,489 (+2423.73%)
Mutual labels:  color, chalk
theme-ui-native
Build consistent, themeable React Native apps based on constraint-based design principles
Stars: ✭ 67 (+13.56%)
Mutual labels:  color
colorscale
Create a color scale from a single color
Stars: ✭ 80 (+35.59%)
Mutual labels:  color
ichiColor
Full features javascript color parser module, perfect work with vue.js; support RGB, HSL, HSV/HSB, HSL255, HSL240, HWB, XYZ, LAB, LUV, LHCab, xyY...
Stars: ✭ 23 (-61.02%)
Mutual labels:  color
color-parse
Color string parser
Stars: ✭ 44 (-25.42%)
Mutual labels:  color
react-native-image-color-picker
Image color picker based on image source provided and return image different color palettes or average color palette
Stars: ✭ 25 (-57.63%)
Mutual labels:  color
Giotto
Theme manager for your app: apply styles to anything you want through a plist file
Stars: ✭ 18 (-69.49%)
Mutual labels:  color
color-alpha
Change alpha of a color string
Stars: ✭ 19 (-67.8%)
Mutual labels:  color
ColorByNumber-iOS
Color by Number: a pixel coloring game on iOS.
Stars: ✭ 50 (-15.25%)
Mutual labels:  color
standard-components
A specification for functional UI components
Stars: ✭ 52 (-11.86%)
Mutual labels:  color
sprout
Golang logging library supporting log retrieval.
Stars: ✭ 85 (+44.07%)
Mutual labels:  color
quickpalette
🏃‍♀️🎨 R package for quick extraction of color palettes from text and images
Stars: ✭ 24 (-59.32%)
Mutual labels:  color
react-native-color-panel
React Native Color Panel Component for iOS and Android 🏳️‍🌈
Stars: ✭ 21 (-64.41%)
Mutual labels:  color
goterminal
A cross-platform Go-library for updating progress in terminal.
Stars: ✭ 56 (-5.08%)
Mutual labels:  color

Chalk





Expressive styling on terminal string.

Highlights

  • Expressive API
  • 256/TrueColor support
  • Nest styles
  • Auto downgrading to terminal supported color
  • No extensions on String
  • rgb & hsl & hsv & hex
  • Built-in 100+ beautiful colors

Usage

Chalk's API is very similar to chalk -- one of the most popular packages on npm.

print(chalk.cyan.on("cyan"))  // `ck` is an alias to `chalk`

// chainable
print(ck.red.bgBlue.italic.underline.on("red bgBlue italic underline"))

// combine terminal string and string
print(ck.red.on("ERROR") + " something went wrong. " + ck.green.on("but no worry! I will..."))

// rgb & hsl & hsv & hex support
print(ck.fg(.rgb(0, 92, 197)).bg(.hex(0xFA4B8B)).on("meow"))

// custom foreground color and background color with 100+ handpicked colors
print(ck.fg(.darkMagenta).bg(.lightGoldenRodYellow).bold.on("hi"))

// nest
print(ck.magenta.underline.on("begin" + ck.red.bold.on("important") + "end"))
print(ck.magenta.underline.on("begin", ck.red.bold.on("important"), "end"))

Styles

Modifiers

reset
bold
faint              // aka dim, not widely supported.
italic
underline
blink
reverse
conceal            // aka hidden, not widely supported.
crossedOut         // aka strikethrough, not widely supported.

Colors

The powerful color system is built on Rainbow.

Ansi16

// with `bg` prefix will set background color

black
red
green
yellow
blue
magenta
cyan
white

blackBright
redBright
greenBright
yellowBright
blueBright
magentaBright
cyanBright
whiteBright

256/TrueColoe

ck.fg(.rgb(0, 100, 200))
ck.fg(.hsl(300, 50, 50))
ck.fg(.hsv(300, 50, 50))
ck.bg(.hex(0x123456))
ck.bg(.hex("#123456")
ck.bg(.hex("#abc")

Built-in 100+ beautiful colors

let color = Color.Material.red50
let color = Color.Material.purple500
let color = Color.CSS.navy
let color = Color.CSS.tomato

ck.fg(color)
ck.bg(color)
//...

Install

dependencies: [
    .package(url: "https://github.com/luoxiu/Chalk", from: "0.2.0")
]
pod 'Chalk', '~> 0.2.0'

Acknowledge

Inspired by the awesome javascript library chalk.

Related

  • Rainbow - 🌈 Color conversion and manipulation library for Swift with no dependence on UIKit/AppKit.

Contribute

If you find a bug, open an issue, if you want to add new features, feel free to submit a pull request. Any contributing is welcome at all times!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].