How can I script this UI?

Is there a way to make a UI appear like this image

So like the other halve is coloured? is this acquired through a script?

However, if you’re editing the text through a script, you should take a look at this post.