innermaio.blogg.se

How to plus a color3 roblox
How to plus a color3 roblox











This form of math is also much easier to type and to read. It also allows Roblox to partially merge the functionality of Vector3s and Color3s which can reduce the amount of work needed to be done when updating Color3s.

how to plus a color3 roblox

This form of Vector3 math/conversion could be used to visualize values and easily convert between color and position. These methods simply treat r as x, g as y, and b as z.Įxamples: local color = omVector3(Vector3.new(255, 127, 0)/255) - OrangeĬolor = color + Color3.new(0, -0.5, 1) - MagentaĬolor = color - Vector3.new(0, -0.5, 1) - Back to orange? Additionally, or in place the above, I propose the following methods be added: I propose that Vector3 math is applied to Color3s values. If Roblox is able to address this issue, it would improve my development experience because there would be no more need to convert Color3s to Vector3s to do simple math on Color3 values.Ĭolor3s and Vector3s are extremely similar but Color3s lack so many of the features that Vector3s have. I’m not really the best at explaining this, so TL DR: linear color space is good for math, gamma color space is not.Īs a Roblox developer, I want to perform math directly on Color3 values, because it is more convenient than converting between data types. Linear colors don’t look like you expect them too, either, and different color gamuts make the problem more complicated. But it’s a mindset change 0-255 makes no sense, you really want 0.0-1.0. Maybe LinearColor3, for example, with conversion functions in between. Sure, it might be simple enough to make the distinction in your API. This issue is compounded by the fact that most image formats are in gamma space, and you need to convert back to gamma space when rendering. Fortunately, conversion is simple… but keeping track of it isn’t. Normals won’t look right, lighting and shading will be too dark or too bright. When you do math with colors in shaders, you must convert to linear space first or everything you do is wrong. Monitors show you color in gamma space because weird reasons I won’t go into. If I take white (255,255,255) and divide it by 2, I get (127.5,127.5,127.5), right? You might expect this to be half as bright.

how to plus a color3 roblox how to plus a color3 roblox

Mathematical operations on colors in gamma space are incorrect.













How to plus a color3 roblox