File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,12 @@ jobs:
2323 fail-fast : false
2424 matrix :
2525 version :
26- - ' 1'
2726 - ' 1.9'
27+ - ' 1'
2828 os :
2929 - ubuntu-latest
30+ - macos-latest
31+ - windows-latest
3032 arch :
3133 - x64
3234 steps :
Original file line number Diff line number Diff line change 163163Function intended for developers that returns the mapped colors from the `colorfier` without the alphas.
164164Alphas are applied in the `Colorfy.colors` function.
165165"""
166+ function getcolors (colorfier:: Colorfier )
167+ throw (ArgumentError ("""
168+ Values of type `$(eltype (colorfier. values)) ` are not supported.
169+ Please make sure your vector of colors has a concrete type.
170+ """ ))
171+ end
172+
166173getcolors (colorfier:: Colorfier{<:Values{Number}} ) =
167174 get (colorscheme (colorfier), values (colorfier), colorrange (colorfier))
168175
Original file line number Diff line number Diff line change @@ -73,6 +73,15 @@ using Test
7373 values = coloralpha .(colors, alphas)
7474 colorfier = Colorfier (values)
7575 @test Colorfy. colors (colorfier) == values
76+
77+ # error: unsupported values
78+ values = [nothing , nothing , nothing ]
79+ colorfier = Colorfier (values)
80+ @test_throws ArgumentError Colorfy. colors (colorfier)
81+ values = Any[:red , :green , :blue ] # vector with non-concrete eltype
82+ alphas = rand (3 )
83+ colorfier = Colorfier (values; alphas)
84+ @test_throws ArgumentError Colorfy. colors (colorfier)
7685 end
7786
7887 @testset " colorfy" begin
You can’t perform that action at this time.
0 commit comments