crayon icon indicating copy to clipboard operation
crayon copied to clipboard

:ribbon: Styling terminal text written in Kotlin

= crayon :toc:

== Install

image::https://api.bintray.com/packages/importre/maven/crayon/images/download.svg[link="https://bintray.com/importre/maven/crayon/_latestVersion"]

repositories {
    jcenter()
}

dependencies {
    compile "com.importre:crayon:$crayon_version"
}

== Examples

=== Java

String title = "Crayon";
System.out.println(Crayon.red(title));

=== Kotlin

val title = "Crayon"
println(title.red())

=== Execution

$ ./gradlew -q example:run

==== Solarized Dracula

image::https://cloud.githubusercontent.com/assets/1744446/26310353/763a3d40-3f3b-11e7-95bb-71623f4c772a.png[dark,500]

==== Solarized Light

image::https://cloud.githubusercontent.com/assets/1744446/26310355/768eb03c-3f3b-11e7-8a10-ff59e3f0b7b3.png[light,500]

== Decorator

  • bold()
  • italic()
  • underline()
  • reversed()

== Color

=== Default

  • black()
  • blue()
  • cyan()
  • green()
  • magenta()
  • red()
  • white()
  • yellow()

=== Bright (Bold)

  • brightBlack()
  • brightBlue()
  • brightCyan()
  • brightGreen()
  • brightMagenta()
  • brightRed()
  • brightWhite()

== Background Color

=== Default

  • bgBlack()
  • bgBlue()
  • bgCyan()
  • bgGreen()
  • bgMagenta()
  • bgRed()
  • bgWhite()
  • bgYellow()

=== Bright (Bold)

  • bgBrightBlack()
  • bgBrightBlue()
  • bgBrightCyan()
  • bgBrightGreen()
  • bgBrightMagenta()
  • bgBrightRed()
  • bgBrightWhite()
  • bgBrightYellow()

== Related

  • https://github.com/importre/hello-kotlin[hello-kotlin] - kotlin cli example
  • https://github.com/importre/progress[progress] - Terminal progress written in Kotlin Edit

== License

MIT © Jaewe Heo