local function setTint(sprite, tint) -- sprites have a similar general structure, be it a plain sprite, a rotated sprite or an animation -- we know this structure and can start working on setting its tint right away log("Entered setTint\nsprite: "..serpent.block(sprite)) if sprite.layers then for i,layer in pairs(sprite.layers) do setTint(layer,tint) end else if sprite.hr_version then setTint(sprite.hr_version,tint) end log(serpent.block(sprite)) sprite.tint = tint end end local function solveWorldPoints(spriteTable,tint) log("spriteTable: "..serpent.block(spriteTable)) for i,sprite in pairs(spriteTable) do log("solveWorldPoints\ni: "..tostring(i).."\nsprite: "..serpent.block(sprite)) if type(sprite) == "table" then setTint(sprite,tint) else log("Ignoring key "..i.." because it's a "..type(sprite).. " value!") end end end solveWorldPoints(data.raw["offshore-pump"]["offshore-pump"].graphics_set.animation, {255, 50, 50})