colortriangle | HSL based color picker | Datepicker library
kandi X-RAY | colortriangle Summary
kandi X-RAY | colortriangle Summary
[UNMAINTAINED] HSL based color picker.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of colortriangle
colortriangle Key Features
colortriangle Examples and Code Snippets
Community Discussions
Trending Discussions on colortriangle
QUESTION
I have a model consisting of three variables u,v,w which change with respect to time and with respect to space. I am especially interested in the ratio of the three variables. But instead of showing three plots, each one for one variable, I would rather like to use only one plot.
My idea is to use the Maxwell triangle (color triangle, see http://homepages.abdn.ac.uk/npmuseum/article/Maxwell/MaxTri.html). I can easily scale each variable that its maximum is at 1. But I don't know whether this idea is realizable. If it makes sense, it should already exist. My question:
- How do I convert the three variables to a single value which represents a color (e.g., if I have a filled contour plot, I want each grid cell to have "its ratio")?
- Can I use the color triangle as a colorbar?
I try to give a short example to make it easier to understand:
...ANSWER
Answered 2018-Jun-18 at 00:24To answer the first question, there are many things that should be noted.
To start with, the only way that a single value can represent a color is using a colormap, which maps a scalar to a color. However, the Maxwell triangle cannot be reduced to a single value.
That does not mean that the maxwell triangle cannot be used as a kind of 3D colormap, mapping 3 values to a color. In fact it is quite natural to do, because the Maxwell uses 3 values a
, b
and c
so that the color can be represented in RGB coordinates as (a,b,c)
. The only thing missing is the normalization.
In the link provided, the Maxwell triangle is defined such that a+b+c=1
. However, matplotlib accepts RGB coordinates as 3 floats between 0 and 1, where white is obvsiously 1,1,1
, instead of 1/3,1/3,1/3
. Thus, each i,j
will have three values that must be converted to 3 floats between 0 and 1 taking this into account.
Therefore, instead of normalizing dividing by the sum (to get a+b+c=1
) we have to normalize dividing by the maximum value of each trio.
Eventually, the resulting image can be shown using imshow
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install colortriangle
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page