Hi all,
We've recently reworked the handling of Colors by Julia into a few new
packages:
https://github.com/JuliaGraphics/ColorTypes.jl
https://github.com/JuliaGraphics/Colors.jl
https://github.com/JuliaGraphics/ColorVectorSpace.jl
and are in the process of switching most of the julia package ecosystem from
Color.jl to Colors.jl. This is going to be a breaking change, because the type
names are different (which is part of the motivation for this change). More
background is discussed here:
https://github.com/JuliaLang/Color.jl/issues/101
To try to minimize any transition-induced pain, we're going to try to
synchronize the switch to Colors.jl across all of those packages. I'm
tentatively hoping to switch Tuesday or Wednesday, depending on how many
issues crop up. No one should switch before that, or you'll be left in a state
of inconsistency across packages that use colors.
If you haven't received a pull request from me, it means you're on your own
with regard to this change. However, I'm happy to advise/help out. I've found
the shell script below to be immensely helpful.
Any questions? Feel free to respond here or by filing issues over at Colors.jl
or ColorTypes.jl.
Best,
--Tim
# Intended to be run from the top directory in a package
# Do not run this twice on the same source tree without discarding
# the first set of changes.
sed -i 's/\bColor\b/Colors/g' REQUIRE
fls=$(find . -name "*.jl")
sed -i 's/\bColor\b/Colors/g' $fls # Color -> Colors
sed -i -E 's/\bcolor\("(.*?)"\)/colorant\"\1\"/g' $fls # color("red") ->
colorant"red"
sed -i 's/AbstractAlphaColorValue/TransparentColor/g' $fls
sed -i 's/AlphaColorValue/TransparentColor/g' $fls # might mean ColorAlpha
sed -i 's/ColorValue/Color/g' $fls
sed -i 's/ColourValue/Color/g' $fls
sed -i -E 's/\bLAB\b/Lab/g' $fls
sed -i -E 's/\bLUV\b/Luv/g' $fls
sed -i -E 's/\b([a-zA-Z0-9_\.]+)\.c\.(\w)\b/\1\.\2/g' $fls # colval.c.r ->
colval.c
# This next one is quite dangerous, esp. for LCHab types...
# ...on the other hand, git diff is nice about showing the things we should fix
sed -i -E 's/\b([a-zA-Z0-9_\.]+)\.c\b/color(\1)/g' $fls
# These are not essential, but they generalize to RGB24 better
# However, they are too error-prone to use by default since other color
# types like Lab have fields with the same names
#sed -i -E 's/\b([a-zA-Z0-9_\.]+)\.r\b/red(\1)/g' $fls # c.r -> red(c)
#sed -i -E 's/\b([a-zA-Z0-9_\.]+)\.g\b/green(\1)/g' $fls
#sed -i -E 's/\b([a-zA-Z0-9_\.]+)\.b\b/blue(\1)/g' $fls
#sed -i -E 's/\b([a-zA-Z0-9_\.]+)\.alpha\b/alpha(\1)/g' $fls # c.alpha ->
alpha(c)