Attempting to invert player colors and textures

I am trying to create a script that inverts the skin color and textures of the player without changing the lighting. I managed to create a function that inverts any color I give to it, and I managed to invert the skin color.

However, I have been unable to change the player textures using an EditableImage, despite managing to invert the colors of the textures. I believe the reason why is because accessories use a SpecialMesh instead of a MeshPart, and the former does not have EditableImage support. I also believe the clothing and pants assets do not support EditableImage, so I’m not sure how to go about this.

Any ideas or ways of getting around it?

Maybe you could use the lighting to reverse the screen color, and then make the map’s colors reversed so you don’t see a difference
And if your map is outside you will have to also have to reverse the colors of the skybox

A possible solution is to add a highlight to the character and set its transparency to -1, its color to 0.5 (127 127 127) and its outline transparency to 0.9999

4 Likes

How the hell did this work? This is incredible, thank you so so much!

Highlights currently have a glitch where setting them above 1 transparency or below 0 seemingly affects the lighting in a similar fashion to changing the saturation on ColorCorrectionEffect. I haven’t seen it used in game yet, but you can do lots of cool things with it as it’s the first thing I’ve found that lets you invert colors / change the lighting for specific things.
This effect only works when you can see the surface of the part and it isn’t transparent, unless it’s material is glass, which lets you make it transparent and put a “mask” over the world behind the glass. Be aware that using the glass material will still reflect the sunlight, but you can remove it by inverting the rotation matrix (or by doing workspace.Part.CFrame = workspace.Part.CFrame:ToWorldSpace(CFrame.new(0,0,0,-1,0,0,0,-1,0,0,0,-1) which will change the orientation of the part (basically turning it 180 degrees in each axis). Saving then loading the part will result in its CFrame to revert, so you will need a script to do it for you, as well as using the rotate tool in studio.

While it is similar, it is definitely not the same. I imagine what is happening here is that between 0 and 1, the color of the background is interpolated based on its fill transparency, resulting in the new color, but setting it above 1 transparency multiplies the color by 1.1 (extrapolation) which results in richer colors which are mapped between 0 and 255, while setting it below 0 multiplies the colors by a negative amount, resulting in flipped colors due to brighter ones decreasing faster than darker ones (123 81 212:Light purple → -123 -81 -212:Yellow green) or by finding the distance of each channel to 255

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.