Skip to content

Instantly share code, notes, and snippets.

@kamescg
Created September 5, 2022 23:55
Show Gist options
  • Save kamescg/ea79423420ffb3daa9218b88095cd69c to your computer and use it in GitHub Desktop.
Save kamescg/ea79423420ffb3daa9218b88095cd69c to your computer and use it in GitHub Desktop.
PixelPooly Render
function _render(bytes memory input) internal view returns (string memory) {
(uint8 head, uint8 body, uint8 headAcc, uint8 bodyAcc, uint8 bg) = abi.decode(
input,
(uint8, uint8, uint8, uint8, uint8)
);
return
string(
abi.encodePacked(
svg.start(),
_registry(PIXEL_POOLY_V0, abi.encode(4, bg)),
_registry(PIXEL_POOLY_V0, abi.encode(0, head)),
_registry(PIXEL_POOLY_V0, abi.encode(1, body)),
_registry(PIXEL_POOLY_V0, abi.encode(2, headAcc)),
_registry(PIXEL_POOLY_V0, abi.encode(3, bodyAcc)),
svg.end()
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment