Help with hex calculations

This is absolutely splendid, thanks! I had already found the page from Redblob Games, and I was preparing to use those methods, but your post gives the algorithm in a ready-to-type-in form!

I have been busy splitting my code into a fourth action counter (as discussed in my other thread about execution speed), so that the added calculations will not slow the code down.