Dimension, graph and hypergraph coloring