Skip to content

Commit 0313a66

Browse files
committed
Merge branch 'main' into styled-strings
2 parents ac70dc6 + 37f231b commit 0313a66

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "b8865327-cd53-5732-bb35-84acbb429228"
33
license = "MIT"
44
desc = "Unicode-based scientific plotting for working in the terminal"
55
authors = ["Christof Stocker <stocker.christof@gmail.com>", "T Bltg <tf.bltg@gmail.com>"]
6-
version = "3.7.0"
6+
version = "3.7.1"
77

88
[deps]
99
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"

src/UnicodePlots.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ include("interface/imageplot.jl")
114114
function __init__()
115115
forced_24bit() && return init_24bit()
116116
forced_8bit() && return init_8bit()
117-
Base.get_have_truecolor() ? init_24bit() : init_8bit()
117+
get_have_truecolor() ? init_24bit() : init_8bit()
118+
nothing
118119
end
119120

120121
# COV_EXCL_START

src/common.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ function colormode!(mode)
249249
nothing
250250
end
251251

252+
get_have_truecolor() =
253+
if isdefined(Base, :get_have_truecolor)
254+
Base.get_have_truecolor()
255+
else
256+
# see gist.github.com/XVilka/8346728#checking-for-colorterm
257+
lowercase(get(ENV, "COLORTERM", "")) ("24bit", "truecolor")
258+
end
259+
252260
# specific to UnicodePlots
253261
forced_24bit() = lowercase(get(ENV, "UP_COLORMODE", "")) ("24", "24bit", "truecolor")
254262
forced_8bit() = lowercase(get(ENV, "UP_COLORMODE", "")) ("8", "8bit")

0 commit comments

Comments
 (0)