Skip to content

Commit b0c70db

Browse files
author
Kristoffer Carlsson
authored
fix on 1.5 (#34)
1 parent 4dd77e5 commit b0c70db

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Crayons"
22
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
3-
version = "4.0.1"
3+
version = "4.0.2"
44

55
[compat]
66
julia = "1.0"

src/crayon.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,15 @@ Base.inv(c::Crayon) = Crayon(inv(c.fg), inv(c.bg), ANSIStyle(), # no point takin
105105
inv(c.bold), inv(c.faint), inv(c.italics), inv(c.underline),
106106
inv(c.blink), inv(c.negative), inv(c.conceal), inv(c.strikethrough))
107107

108+
function _have_color()
109+
if isdefined(Base, :get_have_color)
110+
return Base.get_have_color()
111+
else
112+
Base.have_color
113+
end
114+
end
108115
function Base.print(io::IO, x::Crayon)
109-
if anyactive(x) && (Base.have_color || _force_color())
116+
if anyactive(x) && (_have_color() || _force_color())
110117
print(io, CSI)
111118
if (x.fg.style == COLORS_24BIT || x.bg.style == COLORS_24BIT)
112119
if _force_256_colors()

0 commit comments

Comments
 (0)