Inventory Slot Material - math nodes

I am doing an inventory system, similar to Tarkov.
Slot grid based.

Not all slots are the same size and not wanting to simply scale the textures, because of blur, now i have a list of base slot textures, ranging from 64x64 to 384x192.

Slot_96x96

So, i was thinking to try out a material instead, using math nodes to re-create the same texture.

From two channels of the mask, i extracted two lines, which with Sine, are kept caught in the center, forming a plus symbol. Cleaned of blur.
Then from two channels of the mask, and its reverse sides, as well, i made the edges, then inverted into an inner square. Cleaned of blur.

This is what i think is the cheapest way to do it, however, I can’t figure out where to inject a constant to correct the colors.

image

Anywhere i link and add a constant color, it will only color the edges/corners.
Basically the background of the image.

How can i get control over each colors and invert them ?
Is there a better way to code it ? Considering its spawned hundreds of times, being the slot of any inventory.

Blur? As in - they stretch? If all you want is a frame like above, perhaps it would be easier to use 9-Slice? Scroll down to Setting Image States:

ranging from 64x64 to 384x192

You’d need a single 64x64 png to cover all sizes.

Considering its spawned hundreds of times, being the slot of any inventory.

Consider the Tile View widget.