Closed Wh20-fly closed 4 years ago
Hello,
please specify your question a little bit more. Would you like to know how the colors for surfaces are being generated? Or how you can change these colors and use custom colors? Or how these colors are mixed (proportions of other mixed colors)?
I just put the example of the purple/red label below in case that is what you need:
(Source: https://www.colorhexa.com/9f0052)
Hi, @AlexanderJuestel I want to know how these colors are mixed (RGB Decima)?,I open the internet link you gave,but when I enter the color number,for example #ffbe00,it did't show the answer of RGB Decima,it's the following answer.
in python, you can also do this to convert the hexstring to rgb:
>>> import matplotlib.colors as mcolors
>>> print(mcolors.hex2color('#9f0052'))
(0.6235294117647059, 0.0, 0.3215686274509804)
Hi, @AlexanderJuestel I want to know how these colors are mixed (RGB Decima)?,I open the internet link you gave,but when I enter the color number,for example #ffbe00,it did't show the answer of RGB Decima,it's the following answer.
https://www.colorhexa.com/ffbe00 works for me, with RGB Decimal being (255, 190, 0) or (1.0, 0.745, 0.0). But I think Elisa's tip is great. That way, you can directly access the corresponding RGB values in code. I didn't know that feature of matplotlib, so thanks @elimh :)
@wh19971014,
Did this solve your issue or are there any other open questions?
Hi, @elimh your way can only show the the proportinon of other mixed colors which make up a surface's color,but it can't show the RGB value of mixed colors
Hey,
An RGB color value is specified with: rgb(red, green, blue).
Each parameter (red, green, and blue) defines the intensity of the color as an integer between 0 and 255 with 0 as the lowest and 255 with the highest intensity.
If you multiply the result of @elimh with 255 you should get your rgb value. So your purple would convert to rgb(159,0,82).
Hello,
That was only the percentage that was shown. You would have to convert it back to values between 0 and 1 or 0 and 255.
Hi, @AlexanderJuestel now I know what @elimh means, multipling the result of @elimh with 100 should get my rgb value,not multypling 255. on your comment the RGB value of "#9f0052" is (62,0,32).
Hey,
This was not the rgb value but the fraction between the different colors.
Anyway, if your issue has been solved now, feel free to close the issue.
Let us know if you have any further questions.
Alex
What is your question? The formation generated by GemPy has different.Under what color mode are these colors generated,that is ,what is the proportinon of other mixed colors which make up a surface's color.For example the red of the following photo.