Comments (2)
Hi! I don't have any insight in any "correct" way of working with colorschemes - perhaps there are colour specialists who have better insight, or perhaps there are best practices current in other language's color libraries - I wouldn't know myself.
As you say, it doesn't seem to difficult to modify them manually:
using ColorSchemes, Colors
cs = deepcopy(ColorSchemes.RdBu)
cs.colors[6] = colorant"green" # for testing :)
![Screenshot 2023-11-27 at 11 47 19](https://private-user-images.githubusercontent.com/52289/285852315-f5a524c2-b321-425e-a8fc-8932e9f3a959.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk4NzIyOTIsIm5iZiI6MTcxOTg3MTk5MiwicGF0aCI6Ii81MjI4OS8yODU4NTIzMTUtZjVhNTI0YzItYjMyMS00MjVlLWE4ZmMtODkzMmU5ZjNhOTU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAxVDIyMTMxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdjYmQzOTBiODRkZmUyY2UzYjAwY2YzYTRlZTBlODdkMjMyNTBlM2Q4ZmExYjFlNGZjOTY3ZDYyMGNjMWZlYjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.yMk0nzKrB8kgBc_K9iXSoYtGaHlG3S4nHD3Tdz4v3eI)
This one (RdBu
) is from ColorBrewer, so perhaps you can locate the method they used to build this scheme and modify it...
To build color schemes in a more programmatic way, you could look at ColorSchemeTools.jl but I don't know the method for making this particular one.
from colorschemes.jl.
Oh I did not mean to go as deep as adapting the code that generated the original colors! I was merely fishing for things like you just wrote, which looks much simpler than mine. For the record, I think I will be using a function like below from now on
function withwhitecenter(cs)
cs = deepcopy(cs)
cs.colors[end÷2+1] = colorant"white"
return cs
end
from colorschemes.jl.
Related Issues (20)
- OutOfMemoryError() HOT 1
- Release 3.20.0 HOT 1
- Release 3.21.0 HOT 1
- Release v3.22.0 HOT 1
- Kindlmann colormap HOT 4
- Release 3.23.0 HOT 1
- Scientific colour maps v8.0 HOT 6
- PNW colors HOT 6
- Release 3.24.0 HOT 1
- That `*` can be used to concatenate should be documented
- How do I know if a color scheme is continuous or categorical? HOT 2
- A consistent case pattern
- Unnecesary licence files
- Releases HOT 3
- Documentation `get_inverse` example is broken HOT 1
- optimized get(colorscheme, data) function HOT 1
- Release 3.18.0 HOT 3
- Release 3.19.0 HOT 1
- `firstindex` method error in color scheme HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colorschemes.jl.