Another ANSI colour library for Clojure
deps.edn
:
{:deps {com.github.clojusc/colours {:mvn/version "0.2.0"}}}
A lein project.clj
file:
(defproject my-project "1.0.0"
:dependencies [[com.github.clojusc/colours "0.2.0"]])
Run the project's demo directly, via :exec-fn
:
$ clojure -X:run-x
Hello, Clojure!
The demo runs example code like the following:
(ns clojusc.colours
(:require [clojusc.colours.core :as c]
[clojusc.colours.attr :as attr]))
(defn my-fun []
(c/print (c/colour attr/fg-green attr/bold) "Hello, ")
(c/print (c/colour attr/fg-cyan) "World")
(c/println (c/colour attr/fg-green attr/bold) "!\n")
(c/red "This is red text\n")
(c/green "This is green text\n")
(c/blue "This is blue text\n")
(c/println (c/colour attr/fg-yellow attr/bold) "Bold yellow text")
(let [orange (c/rgb 255 128 0)]
(c/println orange "This is orange RGB text"))
(println "\nString formatting:")
(println "Status:" (c/str-green "SUCCESS") "- Don't worry, be happy!\n"))
Copyright © 2025 Clojure-Aided Enrichment Center
Apache License, Version 2.0