Single color for each line in three.js

Is it possible to draw a line in three.js with a single color attribute, something similar to x3d’s indexedLineSet than defining a color per vertex?

let material = new THREE.LineBasicMaterial({
    color: 0xff0000,
    vertexColors: THREE.VertexColors
});

Sure, take a look at the webgl_lines_colors example.

/cc