I couldn't get it to work for ages and after much banging of head on desk figured out what the issue was. The wiki says that these are the default values of the channels if they are not specified:
Code: Select all
crafting_machine_tint = { primary = {r=0,g=0,b=0,a=0}, secondary = {r=0,g=0,b=0,a=0}, tertiary = {r=0,g=0,b=0,a=0}, quaternary = {r=0,g=0,b=0,a=0}}
I then tried other tints with various colours and transparencies. They all worked as expected - half transparent red, quarter transparent green etc. - as long as the value wasn't {0,0,0,0}.
Finally I figured out that this achieves the desired effect as a workaround:
Code: Select all
local tint = {
primary = {r=0,g=0,b=0,a=0.000000000000001},
secondary = fluid.base_color,
tertiary = {r=0,g=0,b=0,a=0.000000000000001},
quaternary = {r=1,g=1,b=1,a=1},
}
You can't use any other transparent colour because the crafting machine tints are treated as pre-multiplied - so e.g. transparent red {1,0,0,0} gives odd-looking but correct results because the red channel should be pre-multiplied, e.g. 10% additional red should be {0.1,0,0,0.1} and 0% additional anything is {0,0,0,0}.
What I think should be happening (if full untinted opacity is the desired behaviour for not specifying a crafting machine tint channel) is that the default value should be {1,1,1,1} and explicitly setting {0,0,0,0} should be treated as fully transparent.