Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Printer with meta :color#168

Locked AnsweredbyChemaclass
Chemaclass asked this question inQ&A
Discussion options

What do you think about being able to define the color of the text by the Printer?
How hard would it be to add metadata to theprint-str in order to specify some color?
We could provide a list of default colors like green, yellow, red, white, and black.

I've been thinking/trying something like this

(defnprint-str"Same as print. But instead of writing it to an output stream,  The resulting string is returned."  @{:color color}  [& xs]  (let [len (count xs)        printer (php/:: Printer (nonReadable color))        pp |(php/-> printer (print $))]    (case (count xs)     ... etc ...

But the output I get isCan not resolve symbol 'color'. I think I am using the metadata wrong 🤔

You must be logged in to vote

This was solved by creating a new functionprintln-colorful#202

Replies: 2 comments 1 reply

Comment options

The meta data you mentioned is only available fordef but not fordefn.

Regarding color: Do you want colorful html output or colorful bash output?

You must be logged in to vote
1 reply
@Chemaclass
Comment options

ChemaclassJan 13, 2021
Maintainer Author

I was thinking more about "colorful bash output"

Comment options

Chemaclass
Oct 22, 2022
Maintainer Author

This was solved by creating a new functionprintln-colorful#202

You must be logged in to vote
0 replies
Answer selected byChemaclass
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
solvedQuestion solved
2 participants
@Chemaclass@jenshaase

[8]ページ先頭

©2009-2025 Movatter.jp