-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement of named color charts #359
Comments
Experimentally I tried embedding the colormaps into document as SVGs using Documenter.jl v0.23.3. "Blues" and "Purples" seem to have changed somewhere from ebaf8bf to v0.9.6. In order to find such changes, I think it is useful to generate figures dynamically. However, embedding SVGs is not compatible with the table or list layout of Markdown. In the case of named color charts, it does not matter, though. Of course, it is also OK to embed dynamically generated figures with |
I found some problems with embedding SVGs.
|
Good to see your enthusiasm - I was keen to add some kind of chart to the fledgling docs, but there’s obviously many ways to make them better, particularly if you have the spare time! Also, the theory of sorting colors is above my pay grade... 😂 |
There are a few concerns about generating the charts dynamically. It is a tautology, but when the generation fails, the charts will be lost. In that case, the committer (e.g. someone who just adds named colors to the list) will need to fix the generation script. To do it, the committer will need to study Documenter.jl first and read the ad-hoc generation script. Of course, we can introduce a fallback mechanism. However, it will make the scripts more difficult to understand, since the document generation itself is done inside Documenter.jl. My real aim is to add more doctests. Do you have any thoughts? |
I support your endeavours, of course! But, since these named colors aren't Julia-specific, and don't change very often, I don't see much benefit in spending time engineering sample charts. To be honest, they could even be removed altogether without adversely affecting the user base, who are rarely going to be away from a computer when doing work with colors (and the color swatches display well in Juno and Jupyter, etc...). Perhaps being able to search for named colors from Julia would be an idea worth exploring: julia> findcolor("pink")
Name Red Green Blue
lightpink4 0.545 0.373 0.396
deeppink4 0.545 0.039 0.314
lightpink1 1.0 0.682 0.725
hotpink4 0.545 0.227 0.384
deeppink 1.0 0.078 0.576
pink4 0.545 0.388 0.424
lightpink2 0.933 0.635 0.678
pink 1.0 0.753 0.796
pink3 0.804 0.569 0.62
lightpink 1.0 0.714 0.757
hotpink1 1.0 0.431 0.706
hotpink2 0.933 0.416 0.655
pink1 1.0 0.71 0.773
deeppink3 0.804 0.063 0.463
deeppink1 1.0 0.078 0.576
lightpink3 0.804 0.549 0.584
pink2 0.933 0.663 0.722
hotpink3 0.804 0.376 0.565
hotpink 1.0 0.412 0.706
julia> |
I agree, but if someone can remove the charts without any troubles or hesitation in the future, I also think we don't have to delete them now. I think your Anyway, I'll send my current source codes as a WIP PR for a more thorough discussion. |
I'm sorry, but my recent interest has been fixed in |
No worries, that's a good place for them. There are some interesting challenges with getting good performance and high accuracy, and I'm grateful for your attention to those matters! |
The charts were changed by #374. Let's discuss new APIs like |
It has been on my mind for a while, but the order of colors in the named color charts is perceptually strange. For example, "hotpink4" is darker than "deeppink2".
Of course, I think it is not significant, too, because the charts are only quick-reference/pretty handouts.
Aside from that, I have a suggestion. What about embedding inline SVGs in the HTML document? Although the letters in the current charts are outlined, some browsers allow you to copy and search the embedded SVG texts. Some condensed fonts are available as web fonts.
When we embed the charts, the interactive code technique may be helpful.
https://juliadocs.github.io/Documenter.jl/dev/showcase/#Running-interactive-code-1
Although
AFAIK, the technique is available on the stable version.
FYI, the cause of the strange order is incorrect scaling
/255
.Colors.jl/docs/src/assets/figures/generate-named-color-charts.jl
Lines 3 to 8 in 43d93ff
Colors.jl/docs/src/assets/figures/generate-named-color-charts.jl
Lines 58 to 60 in 43d93ff
The text was updated successfully, but these errors were encountered: