Your mesh is not a simple box, so you’ll need the procedural approach for this. Tricky stuff.
procedural
I wonder if you’re asking for the right thing, and this should be done in material instead Something along the lines of:
Would it make sense?