Make Contract Calls Great Again #35
@@ -67,6 +67,8 @@ palette(light) ->
|
||||
?STRING => ?red,
|
||||
?NUMBER => ?magenta,
|
||||
?OPERATOR => ?brown,
|
||||
line_num => ?brown,
|
||||
cursor => ?black,
|
||||
bg => ?high_white};
|
||||
palette(dark) ->
|
||||
#{?DEFAULT => ?white,
|
||||
@@ -76,6 +78,8 @@ palette(dark) ->
|
||||
?STRING => ?light_red,
|
||||
?NUMBER => ?light_magenta,
|
||||
?OPERATOR => ?yellow,
|
||||
line_num => ?light_cyan,
|
||||
cursor => ?white,
|
||||
bg => ?not_black}.
|
||||
|
||||
color_mode() ->
|
||||
@@ -114,13 +118,15 @@ set_text(STC, Text) ->
|
||||
|
||||
set_colors(STC) ->
|
||||
ok = wxStyledTextCtrl:styleClearAll(STC),
|
||||
Palette = #{bg := BGC} = palette(color_mode()),
|
||||
Palette = #{bg := BGC, cursor := CC, line_num := LNC} = palette(color_mode()),
|
||||
Colorize =
|
||||
fun(Style) ->
|
||||
Color = maps:get(Style, Palette),
|
||||
ok = wxStyledTextCtrl:styleSetForeground(STC, Style, Color),
|
||||
ok = wxStyledTextCtrl:styleSetBackground(STC, Style, BGC)
|
||||
end,
|
||||
ok = wxStyledTextCtrl:setCaretForeground(STC, CC),
|
||||
ok = wxStyledTextCtrl:styleSetForeground(STC, ?wxSTC_STYLE_LINENUMBER, LNC),
|
||||
ok = wxStyledTextCtrl:styleSetBackground(STC, ?wxSTC_STYLE_DEFAULT, BGC),
|
||||
lists:foreach(Colorize, styles()).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user