Converting colors (3 to 1)
As the title said,
The issue I don't know how to convert 3 values of colors to 1, let's say yellow ( R = 255, G = 255, B = 0), in the 255 one color value is 111 ( I didnt calculate this, I have a pic that has every value from 0 to 255). I want to know how to calculate that. |
Re: Converting colors (3 to 1)
What? Rgb is 3 colors, red, green and blue. What do you mean 1 value? For rgb you always need 3.
|
Re: Converting colors (3 to 1)
Quote:
I am using random values to make random color to an entity (glow), and this chance we've got this value PHP Code:
|
Re: Converting colors (3 to 1)
Quote:
|
Re: Converting colors (3 to 1)
You didnt get me, that was just an example of the color yellow, the issue is converting the 3 dimensions of the color values to 1 dimension so I can spawn the same color in pev_colormap X value / 3 is not the solution for sure, it will give another color in pev_colormap. pev_rendercolor = 3 dimensions RGB 0-255 0-255 0-256 pev_colormap = 1 dimension 0-255 Edit : correct, its random_float |
Re: Converting colors (3 to 1)
pev_colormap is not what you think it is
https://forums.alliedmods.net/showpo...01&postcount=7 |
Re: Converting colors (3 to 1)
Search hue to RGB colors
|
Re: Converting colors (3 to 1)
I believe this is what I want, I've searched a bit and it's complicated maths, can you give me direct calculation?
I am using random RGB floats for each dimension. |
Re: Converting colors (3 to 1)
I already gave you the answer of how colormap works.
Watch this video, maybe it helps you understand what colormap does |
Re: Converting colors (3 to 1)
1 Attachment(s)
Here ya go a model I use for more clarification, spawn an entity with the glow render mode, make random color values and see how to figure out the same color :
|
All times are GMT -4. The time now is 13:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.