27
27
SimpleColor (r:: Integer , g:: Integer , b:: Integer ) = SimpleColor ((; r= UInt8 (r), g= UInt8 (g), b= UInt8 (b)))
28
28
SimpleColor (rgb:: UInt32 ) = SimpleColor (reverse (reinterpret (UInt8, [rgb]))[2 : end ]. .. )
29
29
30
- convert (:: Type{SimpleColor} , (; r, g, b):: RGBTuple ) = SimpleColor ((; r, g, b))
31
- convert (:: Type{SimpleColor} , namedcolor:: Symbol ) = SimpleColor (namedcolor)
32
- convert (:: Type{SimpleColor} , rgb:: UInt32 ) = SimpleColor (rgb)
30
+ Base . convert (:: Type{SimpleColor} , (; r, g, b):: RGBTuple ) = SimpleColor ((; r, g, b))
31
+ Base . convert (:: Type{SimpleColor} , namedcolor:: Symbol ) = SimpleColor (namedcolor)
32
+ Base . convert (:: Type{SimpleColor} , rgb:: UInt32 ) = SimpleColor (rgb)
33
33
34
34
"""
35
35
tryparse(::Type{SimpleColor}, rgb::String)
@@ -175,7 +175,7 @@ Base.copy(f::Face) =
175
175
f. foreground, f. background, f. underline,
176
176
f. strikethrough, f. inverse, copy (f. inherit))
177
177
178
- function show (io:: IO , :: MIME"text/plain" , color:: SimpleColor )
178
+ function Base . show (io:: IO , :: MIME"text/plain" , color:: SimpleColor )
179
179
skiptype = get (io, :typeinfo , nothing ) === SimpleColor
180
180
skiptype || show (io, SimpleColor)
181
181
skiptype || print (io, ' (' )
@@ -195,7 +195,7 @@ function show(io::IO, ::MIME"text/plain", color::SimpleColor)
195
195
nothing
196
196
end
197
197
198
- function show (io:: IO , color:: SimpleColor )
198
+ function Base . show (io:: IO , color:: SimpleColor )
199
199
show (io, SimpleColor)
200
200
print (io, ' (' )
201
201
if color. value isa RGBTuple
@@ -210,7 +210,7 @@ function show(io::IO, color::SimpleColor)
210
210
print (io, ' )' )
211
211
end
212
212
213
- function show (io:: IO , :: MIME"text/plain" , face:: Face )
213
+ function Base . show (io:: IO , :: MIME"text/plain" , face:: Face )
214
214
if get (io, :compact , false ):: Bool
215
215
show (io, Face)
216
216
if get (io, :color , false ):: Bool
@@ -285,7 +285,7 @@ function show(io::IO, ::MIME"text/plain", face::Face)
285
285
end
286
286
end
287
287
288
- function show (io:: IO , face:: Face )
288
+ function Base . show (io:: IO , face:: Face )
289
289
show (IOContext (io, :compact => true ), MIME (" text/plain" ), face)
290
290
end
291
291
@@ -489,7 +489,7 @@ withfaces(f) = f()
489
489
Merge the properties of the `initial` face and `others`, with
490
490
later faces taking priority.
491
491
"""
492
- function merge (a:: Face , b:: Face )
492
+ function Base . merge (a:: Face , b:: Face )
493
493
if isempty (b. inherit)
494
494
Face (ifelse (isnothing (b. font), a. font, b. font),
495
495
if isnothing (b. height) a. height
@@ -515,7 +515,7 @@ function merge(a::Face, b::Face)
515
515
end
516
516
end
517
517
518
- merge (a:: Face , b:: Face , others:: Face... ) = merge (merge (a, b), others... )
518
+ Base . merge (a:: Face , b:: Face , others:: Face... ) = merge (merge (a, b), others... )
519
519
520
520
# # Getting the combined face from a set of properties ##
521
521
@@ -647,7 +647,7 @@ Load all faces declared in the Faces.toml file `tomlfile`.
647
647
"""
648
648
loaduserfaces! (tomlfile:: String ) = loaduserfaces! (Base. parsed_toml (tomlfile))
649
649
650
- function convert (:: Type{Face} , spec:: Dict )
650
+ function Base . convert (:: Type{Face} , spec:: Dict )
651
651
Face (if haskey (spec, " font" ) && spec[" font" ] isa String
652
652
spec[" font" ] end ,
653
653
if haskey (spec, " height" ) && (spec[" height" ] isa Int || spec[" height" ] isa Float64)
0 commit comments