在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ajalt/mordant开源软件地址(OpenSource Url):https://github.com/ajalt/mordant开源编程语言(OpenSource Language):Kotlin 98.6%开源软件介绍(OpenSource Introduction):MordantColorful styling for command-line applications
Mordant has:
You can read the docs for Mordant 1.0 here.This README documents Mordant 2.0, which is in beta.UsageCreate a import com.github.ajalt.mordant.rendering.TextColors.*
import com.github.ajalt.mordant.rendering.TextStyles.*
val t = Terminal()
t.println(red("This text will be red on terminals that support color")) Multiple stylesimport com.github.ajalt.mordant.rendering.TextColors.*
val t = Terminal()
t.println("${red("red")} ${white("white")} and ${blue("blue")}") Foreground and background colorst.println((yellow on brightGreen)("this is easy to read, right?")) Background color alonet.println("The foreground ${brightBlue.bg("color will stay the")} same") Combine styles and colorsval style = (bold + white + underline)
t.println(style("You can save styles"))
t.println(style("to reuse")) Nest styles and colorst.println(white("You ${(blue on yellow)("can ${(black + strikethrough)("nest")} styles")} arbitrarily")) True color and other color spacesimport com.github.ajalt.mordant.rendering.TextColors.Companion.rgb
t.println(rgb("#b4eeb4")("This will get downsampled on terminals that don't support truecolor")) Terminal color support detectionBy default, For example, to always output ANSI RGB color codes, even if stdout is currently directed to a file, you can do this: Terminal(AnsiLevel.TRUECOLOR) TablesUse the 全部评论
专题导读
上一篇:nfrankel/kaadin: Kotlin DSL for Vaadin发布时间:2022-07-10下一篇:ShakilAhmedShaj/EasyTask_MVVM_Kotlin: Todo app based on MVVM, Kotlin Coroutines, ...发布时间:2022-07-10热门推荐
热门话题
阅读排行榜
|
请发表评论