I want to give TextButton a basic backgroundColor to distinguish it from a regular label.
Right now I am just drawing a filled rectangle behind the TextButton that I create with color (r,g,b,a) via a TextureRegion (in scala):
val pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888)
pixmap.setColor(r, g, b, a)
pixmap.fillRectangle(0, 0, 1, 1)
val texture = new Texture(pixmap)
txr = new TextureRegion(texture)
pixmap.dispose
However, this means that every time I change the values of (r,g,b,a), a new texture is made, which is quite expensive. Therefore, I was wondering if there are better/easier ways to obtain a similar (visual) result.