# Change color in Line2

**URL:** <https://discourse.threejs.org/t/change-color-in-line2/24469>\
**Category:** Questions\
**Tags:** fat-lines\
**Created:** [March 17, 2021, 2:37am UTC](https://discourse.threejs.org/t/change-color-in-line2/24469 "2021-03-17T02:37:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yongs](https://avatars.discourse-cdn.com/v4/letter/y/9f8e36/32.png) [@Yongs](https://discourse.threejs.org/u/Yongs)\
**Post date:** [March 17, 2021, 2:37am UTC](https://discourse.threejs.org/t/change-color-in-line2/24469/1 "2021-03-17T02:37:41Z")

</div>

hi,  
I draw lines with “Line2”

I try change colors and try again and again…  
but, it always same result black line;

how can i change colors in Line2?  
please save me 😨

this is my create and input color script

```
const positions = [];

      // const colors = [];
      // const color = new THREE.Color(Math.random() * 1, Math.random() * 1, Math.random() * 1);
       var target = new THREE.Vector3(); // create once an reuse it
      // ObjectMesh.getWorldPosition( target );
      // three.scene.updateMatrixWorld(true);
       positions.push(0, 0, 0);
       positions.push(ObjectMesh.position.x, ObjectMesh.position.y, ObjectMesh.position.z);

      // var point = new THREE.Vector3();
      // point.setFromMatrixPosition( ObjectMesh.matrixWorld );

      // colors.push(color.r, color.g, color.b);

       const geometry = new LineGeometry();
       geometry.setPositions( positions );

       geometry.setColors( colors );
       geometry.setColors( 1,0,0 );

       let matLine = new LineMaterial( {
        color: 0xffffff,
        linewidth: 0.003, // in pixels
        vertexColors: true,
        //resolution: // to be set by renderer, eventually
        dashed: true
      })

      let _line = new Line2( geometry, matLine );
      _line.computeLineDistances();
      _line.scale.set( 1, 1, 1 );

      return _line;

```

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/6/c/6c7cc9ca0599f1695e9d42aa3eb27e012dc0133a.png)

---

<div class="post-metadata">

**Author:** ![idris\_tas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/idris_tas/32/21451_2.png) [@idris\_tas](https://discourse.threejs.org/u/idris_tas)\
**Post date:** [October 8, 2021, 12:33pm UTC](https://discourse.threejs.org/t/change-color-in-line2/24469/2 "2021-10-08T12:33:50Z")

</div>

I have the same issue. any solution please?
