An octree is a recursive partition of the unit cube, such that in each step a cube is subdivided into eight smaller cubes. Those cubes that are not further subdivided are the leaves of the octree. We consider the problem of coloring the leaves of an octree using as few colors as possible such that no two of them get the same color if they share a face. It turns out that the number of colors needed depends on a parameter that we call unbalancedness. Roughly speaking, this parameter measures how much adjacent cubes differ in size. For most values of this parameter we give tight bounds on the minimum number of colors, and extend the results to higher dimensions.