@@ -93,8 +93,10 @@ struct Crayon
9393 strikethrough:: ANSIStyle
9494end
9595
96- anyactive (x:: Crayon ) = ((x. reset. active && x. reset. on) || x. fg. active || x. bg. active || x. bold. active || x. faint. active ||
97- x. italics. active || x. underline. active || x. blink. active || x. negative. active || x. conceal. active || x. strikethrough. active)
96+ anyactive (x:: Crayon ) = ((x. reset. active && x. reset. on) ||
97+ x. fg. active || x. bg. active || x. bold. active ||
98+ x. faint. active || x. italics. active || x. underline. active ||
99+ x. blink. active || x. negative. active || x. conceal. active || x. strikethrough. active)
98100
99101Base. inv (c:: Crayon ) = Crayon (inv (c. fg), inv (c. bg), ANSIStyle (), # no point taking inverse of reset,
100102 inv (c. bold), inv (c. faint), inv (c. italics), inv (c. underline),
@@ -270,22 +272,6 @@ function Base.merge(toks::Crayon...)
270272 return tok
271273end
272274
273- function Base. with_output_color (f:: Function , crayon:: Crayon , io:: IO , args... )
274- buf = IOBuffer ()
275- print (buf, crayon)
276- try f (buf, args... )
277- finally
278- print (buf, inv (crayon))
279- print (io, String (take! (buf)))
280- end
281- end
282-
283- Base. print_with_color (crayon:: Crayon , io:: IO , msg:: AbstractString... ) =
284- Base. with_output_color (print, crayon, io, msg... )
285- Base. print_with_color (crayon:: Crayon , msg:: AbstractString... ) =
286- print_with_color (crayon, stdout , msg... )
287-
288-
289275# 24bit -> 256 colors
290276function _to256 (crayon:: Crayon )
291277 fg = crayon. fg
0 commit comments