gempy-project / gempy

GemPy is an open-source, Python-based 3-D structural geological modeling software, which allows the implicit (i.e. automatic) creation of complex geological models from interface and orientation data. It also offers support for stochastic modeling to address parameter and model uncertainties.
https://gempy.org
European Union Public License 1.2
983 stars 234 forks source link

what is the proportinon of other mixed colors which make up a surface's color #423

Closed Wh20-fly closed 4 years ago

Wh20-fly commented 4 years ago

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. 20200519201722

AlexanderJuestel commented 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:

image

(Source: https://www.colorhexa.com/9f0052)

Wh20-fly commented 4 years ago

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. QQ截图20200519220227

elimh commented 4 years ago

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)
Japhiolite commented 4 years ago

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 :)

AlexanderJuestel commented 4 years ago

@wh19971014,

Did this solve your issue or are there any other open questions?

Wh20-fly commented 4 years ago

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

AlexanderJuestel commented 4 years ago

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).

AlexanderJuestel commented 4 years ago

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.

Wh20-fly commented 4 years ago

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).

AlexanderJuestel commented 4 years ago

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