Use the "Magic wand". Click in the first area, and shift click in addtional areas if needed. Bucket-fill with color.
Warning: If you only do this the result will look like crap, because the anti-aliasing pixels will be either removed (jaggy lines) or left out (white halo).
So, the proper way, a bit more complex:
Step 1: make the background transparent
- Add an alpha channel if there is none:
Layer>Transparency>Add alpha channel
- Use the "By color selector" to select the white, with a small threshold
Select>Grow by 1 pixel (so that the selection includes the black lines)
Color>Color to alpha an remove the white
- At that point you can add a new layer, filled with white, and drag it under the layer with the lines, and this should recreate the initial image.
Step2: painting areas (slow but very clean)
- add a transparent layer, move it to between the layer with the lines and the white background (let's call it "Painted areas")
- Select the "lines" layer in the Layers list (ctrl-L)
- Use the Magic wand to select the areas to paint (use shift-click to add several areas if needed)
Select>Grow by one pixel (so the selection includes the black lines)
- Select the "Painted areas" layer in the Layers list
- Bucket-fill the selection ("Fill whole selection" option) with the required color.
- Repeat for each color
Your layers list should look like this:
Step2: painting areas (faster but a bit less clean)
- add a transparent layer, move it to between the layer with the lines and the white background
- Set the bucket-fill tool to "Fill contiguous areas", "Sample merged", and a somewhat high threshold (around 100).
- Set the color and click in the areas. The tough part if finding a threshold that includes all the edge pixels (no unpainted pixels) and that doesn't cross the lines and selects several adjacent areas.
(The Layers list is identical to the one above)