Skip to content

Commit

Permalink
make Colors direct dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Stukalov committed Jul 7, 2024
1 parent 76ffe57 commit c0ec15c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ uuid = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
version = "0.8.19"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Expand All @@ -27,7 +28,6 @@ Requires = "1"
julia = "1.4"

[extensions]
ColorsExt = "Colors"
DataFramesExt = "DataFrames"
DistributionsExt = "Distributions"
IJuliaExt = "IJulia"
Expand All @@ -43,7 +43,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
test = ["Dates", "DelimitedFiles", "Test", "DataFrames"]

[weakdeps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
Expand Down
8 changes: 0 additions & 8 deletions ext/ColorsExt.jl

This file was deleted.

1 change: 1 addition & 0 deletions src/PlotlyBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ using DocStringExtensions
using UUIDs
using Dates
using Logging
using Colors
using ColorSchemes
using Parameters

Expand Down
2 changes: 2 additions & 0 deletions src/json.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ _json_lower(x::Union{Tuple,AbstractArray}) = _json_lower.(x)
_json_lower(d::Dict) = Dict{Any,Any}(k => _json_lower(v) for (k, v) in pairs(d))
_json_lower(a::HasFields) = Dict{Any,Any}(k => _json_lower(v) for (k, v) in pairs(a.fields))
_json_lower(c::Cycler) = c.vals

_json_lower(c::Colorant) = string("#", Colors.hex(c))
function _json_lower(c::ColorScheme)::Vector{Tuple{Float64,String}}
N = length(c.colors)
map(ic -> ((ic[1] - 1) / (N - 1), _json_lower(ic[2])), enumerate(c.colors))
Expand Down

0 comments on commit c0ec15c

Please sign in to comment.