Skip to content

Commit ef2c459

Browse files
committed
change colors to blue-magenta instead of red-green combo
Since red-green color blindness is common, use a blue-magenta combo instead. Also, make the toggled option bold and change the color of first line of the menu to green to reduce the amount of blue in the menu.
1 parent 897952f commit ef2c459

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/ui.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const debugcolors = (:nothing, :light_black, :yellow)
9494
function usage(@nospecialize(view_cmd), annotate_source, optimize, iswarn, hide_type_stable, debuginfo, remarks, with_effects, inline_cost, type_annotations, highlight,
9595
custom_toggles::Vector{CustomToggle})
9696
colorize(active_option::Bool, c::Char) = stringify() do io
97-
active_option ? printstyled(io, c; color=:green) : printstyled(io, c; color=:red)
97+
active_option ? printstyled(io, c; color=:blue) : printstyled(io, c; color=:magenta)
9898
end
9999

100100
colorize(s::AbstractString; color::Symbol = :cyan) = stringify() do io
@@ -105,7 +105,7 @@ function usage(@nospecialize(view_cmd), annotate_source, optimize, iswarn, hide_
105105
ioctx = IOContext(io, :color=>true)
106106

107107
println(ioctx,
108-
colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color=:blue))
108+
colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color=:green))
109109
print(ioctx,
110110
colorize("Toggles"), ": [",
111111
colorize(iswarn, 'w'), "]arn, [",

test/test_terminal.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ end
4141
@test Cthulhu.default_terminal() isa REPL.Terminals.TTYTerminal
4242
end
4343
colorize(active_option::Bool, c::Char) = Cthulhu.stringify() do io
44-
active_option ? printstyled(io, c; color=:green) : printstyled(io, c; color=:red)
44+
active_option ? printstyled(io, c; bold=true, color=:blue) : printstyled(io, c; color=:magenta)
4545
end
4646

4747
colorize(s::AbstractString; color::Symbol = :cyan) = Cthulhu.stringify() do io
@@ -80,14 +80,14 @@ end
8080
@test occursin('[' * colorize(true, 'o') * "]ptimize", lines)
8181
@test occursin('[' * colorize(true, 'T') * "]yped", lines)
8282

83-
@test occursin('\n' * colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color = :blue), lines) # beginning of the line
83+
@test occursin('\n' * colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color = :green), lines) # beginning of the line
8484
@test occursin('', lines)
8585
write(in, 'o') # switch to unoptimized
8686
lines = cread(out)
8787
@test occursin("invoke simplef(::Float32,::Int32)::Float32", lines)
8888
@test occursin(r"\(z = a \* a\)\u001B\[\d\dm::Float32\u001B\[39m", lines)
8989
@test occursin('[' * colorize(false, 'o') * "]ptimize", lines)
90-
@test occursin('\n' * colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color = :blue), lines) # beginning of the line
90+
@test occursin('\n' * colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color = :green), lines) # beginning of the line
9191
@test occursin("• %1 = *(::Float32,::Float32)::Float32", lines)
9292
# Call selection
9393
write(in, keydict[:down])
@@ -119,7 +119,7 @@ end
119119
@test occursin(r"z.*::Float32", lines)
120120
@test occursin(r"\nBody.*Float32", lines)
121121
@test occursin('[' * colorize(true, 'w') * "]arn", lines)
122-
@test occursin('\n' * colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color = :blue), lines) # beginning of the line
122+
@test occursin('\n' * colorize("Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark."; color = :green), lines) # beginning of the line
123123
@test occursin("• %1 = *(::Float32,::Float32)::Float32", lines)
124124
# Source view
125125
write(in, 'S')

0 commit comments

Comments
 (0)