I want to put a Frame underneath the Roblox top bar, which can be achieved by the following code:
local barFrame = Instance.new('Frame', script.Parent) barFrame.BackgroundColor3 = Color3.new(0, 126/255, 138/255) barFrame.Position = UDim2.new(0, 0, 0, -36) barFrame.Size = UDim2.new(1, 0, 0, 36) barFrame.ZIndex = 10
In this case, putting the Frame underneath the top bar with the color (0,126,138) makes the top bar appear to have the opaque color of (16,78,84). The top bar itself is solid black with a transparency of .5. How can I go from what I want the opaque color to be to what color the frame should be?
If you head over to WolframAlpha and enter the following formula I found into the box, substituting RED, GREEN and BLUE for their respective values (0-255) then you should end up with values for x, y and z, being RED, GREEN and BLUE respectively (0-1).
(31/255,31/255,31/255,0.5) * 0.5 + (x,y,z,w) * 0.5 = (RED/255, GREEN/255, BLUE/255,1); solve for x, y, z, w
e.g: I want the top bar colour to be RGB(56,95,128) so I enter the following formula into WolframAlpha:
(31/255,31/255,31/255,0.5) * 0.5 + (x,y,z,w) * 0.5 = (56/255, 95/255, 128/255,1); solve for x, y, z, w
WolframAlpha gives me x = 0.31765, y = 0.62353 and z = 0.88235.
I pop them into the BackgroundColor3 value of the opaque frame:
Color3.new(0.31765,0.62353,0.88235)
And I end up with a top bar of colour RGB(56,95,128)
NOTE: This may not work with every colour you want.
You cannot change the color of the roblox topbar. There's no possible way to do this.
An alternative would be to make the TopBar's transparency .5, then place a Gui underneath it with your wanted color. The color would be several shades darker, though.
Ultimately there's no good way to do this and you should just make the TopBar's Transparency 0. It will look the best.