Skip to content

Commit

Permalink
fix: LineMaterial accepts THREE Colors (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Dax authored Jun 14, 2021
1 parent 0061945 commit 67cff5f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lines/LineMaterial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ShaderLib, ShaderMaterial, UniformsLib, UniformsUtils, Vector2, ShaderMaterialParameters } from 'three'
import { ShaderLib, ShaderMaterial, UniformsLib, UniformsUtils, Vector2, ShaderMaterialParameters, Color } from 'three'

import { ColorOptions } from '../types/shared'

Expand Down Expand Up @@ -270,7 +270,7 @@ class LineMaterial extends ShaderMaterial {

public dashed = false

public color: number = 0
public color: Color = new Color(0x000000)
public lineWidth: number = 0
public dashScale: number = 0
public dashOffset: number = 0
Expand Down Expand Up @@ -300,7 +300,8 @@ class LineMaterial extends ShaderMaterial {
},

set: function (value) {
this.uniforms.diffuse.value = value
const colorObj = new Color(value)
this.uniforms.diffuse.value = colorObj.getHex()
},
},
linewidth: {
Expand Down

1 comment on commit 67cff5f

@vercel
Copy link

@vercel vercel bot commented on 67cff5f Jun 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.