Colorings of sparse graphs and multigraphs