Applying per-vertex colors to new Bmesh
Loop over face loops.

import bpy
import bmesh
from random import uniform
context = bpy.context
mesh = context.object.data
bm = bmesh.new()
bm.from_mesh(mesh)

color_layer = bm.loops.layers.color.new("color")
# make a random color dict for each vert
# vert_color = random_color_table[vert]

def random_color(alpha=1):
    return [uniform(0, 1) for c in "rgb"] + [alpha]
random_color_table = {v : random_color()
                      for v in bm.verts}
for face in bm.faces:
    for loop in face.loops:
        loop[color_layer] = random_color_table[loop.vert]
bm.to_mesh(mesh)  


Should your table be indexed by vert index use something like   

color_table[loop.vert.index]


If you notice that you are getting -1 for index value run 

bm.verts.ensure_lookup_table()


Related

How to get random color variation on a single mesh?

set a specified vertex color to black via python