Add underline and bold only codes
This commit is contained in:
parent
9e66ca99c8
commit
8a756ea9c7
2 changed files with 12 additions and 0 deletions
|
@ -13,6 +13,8 @@ syntax to add colours.
|
||||||
%% The colour can be one of:
|
%% The colour can be one of:
|
||||||
%%
|
%%
|
||||||
%% ! - resets the output
|
%% ! - resets the output
|
||||||
|
%% ^ - bold (no colour change)
|
||||||
|
%% __ - (two _) makes text underlined (no colour change)
|
||||||
%% x,X - black
|
%% x,X - black
|
||||||
%% r,R - red
|
%% r,R - red
|
||||||
%% g,G - greeen
|
%% g,G - greeen
|
||||||
|
|
10
src/cf.erl
10
src/cf.erl
|
@ -28,6 +28,7 @@
|
||||||
%% The colour can be one of:
|
%% The colour can be one of:
|
||||||
%%
|
%%
|
||||||
%% ! - resets the output
|
%% ! - resets the output
|
||||||
|
%% ^ - makes text bold
|
||||||
%% x,X - black
|
%% x,X - black
|
||||||
%% r,R - red
|
%% r,R - red
|
||||||
%% g,G - greeen
|
%% g,G - greeen
|
||||||
|
@ -77,6 +78,7 @@ format(Fmt) ->
|
||||||
-define(BC, "\033[1;36m").
|
-define(BC, "\033[1;36m").
|
||||||
-define(BW, "\033[1;37m").
|
-define(BW, "\033[1;37m").
|
||||||
-define(U, "\033[4m").
|
-define(U, "\033[4m").
|
||||||
|
-define(B, "\033[1m").
|
||||||
-define(BGX, "\033[40m").
|
-define(BGX, "\033[40m").
|
||||||
-define(BGR, "\033[41m").
|
-define(BGR, "\033[41m").
|
||||||
-define(BGG, "\033[42m").
|
-define(BGG, "\033[42m").
|
||||||
|
@ -103,9 +105,17 @@ cfmt(S, Enabled) ->
|
||||||
|
|
||||||
cfmt_([$~,$!, _C | S], false) ->
|
cfmt_([$~,$!, _C | S], false) ->
|
||||||
cfmt_(S, false);
|
cfmt_(S, false);
|
||||||
|
cfmt_([$~,$!, $_, _C | S], false) ->
|
||||||
|
cfmt_(S, false);
|
||||||
cfmt_([$~,$#, _C | S], false) ->
|
cfmt_([$~,$#, _C | S], false) ->
|
||||||
cfmt_(S, false);
|
cfmt_(S, false);
|
||||||
|
|
||||||
|
cfmt_([$~, $!, $_, $_ | S], Enabled) ->
|
||||||
|
[?U | cfmt_(S, Enabled)];
|
||||||
|
cfmt_([$~,$!, $^ | S], Enabled) ->
|
||||||
|
[?B | cfmt_(S, Enabled)];
|
||||||
|
cfmt_([$~,$!, $_, $^ | S], Enabled) ->
|
||||||
|
[?U, ?B | cfmt_(S, Enabled)];
|
||||||
?CFMT($!, ?R);
|
?CFMT($!, ?R);
|
||||||
?CFMT($x, ?NX);
|
?CFMT($x, ?NX);
|
||||||
?CFMT($X, ?BX);
|
?CFMT($X, ?BX);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue