Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

How to color the Roblox top bar a certain color?

Asked by
Validark 1580 Snack Break Moderation Voter
9 years ago

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?

2 answers

Log in to vote
3
Answered by
KarlXYZ 120
9 years ago

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.

SOURCE

Ad
Log in to vote
-1
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

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.

0
I LITERALLY WROTE A SCRIPT THAT PUTS A FRAME UNDER THE TOP BAR! READ EVERYTHING I SAID! The question was, you put an opaque frame underneath, and it results in a different color because of the black topbar with a .5 transparency. My questions was how to find what color you should put underneath to achieve a certain overall color of the top bar. Validark 1580 — 9y

Answer this question