So I created inventory UI, it is basically GridContainer ( tried with ItemList too), with texture rects as children. When item is created anew its preview is rendered behind the scenes, creating ImageTexture converted from rendered viewporttexture - and it works, I can save these images, check them out in editor, use it anywhere in sprite2d, their colour is perfect.
I wanted to use these images as previews in inventory grid.
The problem happens when Inventory screen is scaled down due to changing game window size. The smaller inventory parent node is, the more pale color of items get, they are losing brightness and at some point become invisible. Their color is good only at parents scale of 100 %. This effect does not happen when I use any already existing textures, including the very same viewport rendered pictures as long as they were saved as png files instead of created in runtime.
This is very ridicolous problem, is it a thing about storing images ??
This is a process of creating image on the go :
var img = $Control/ViewportContainer/Viewport.get_texture().get_data()
var bg = Image.new() #This is supposed to be final images background
bg.fill(setcolor(data["tier"])) # You know, blue for uncommon and so on
model.queue_free() #model that was taken picture of is released
var pict = ImageTexture.new()
$Control/ViewportContainer/Viewport.disable_3d = true #and studio is too