Skip to content

Commit

Permalink
[three] LineMaterial: fix incorrect type for color (#679)
Browse files Browse the repository at this point in the history
* [three] LineMaterial: fix incorrect type for color

* Consolidate import

---------

Co-authored-by: Nathan Bierema <[email protected]>
  • Loading branch information
sguimmara and Methuselah96 authored Nov 17, 2023
1 parent ba58d77 commit 171c6c5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/three/examples/jsm/lines/LineMaterial.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Color, MaterialParameters, ShaderMaterial, Vector2 } from '../../../src/Three.js';
import { Color, ColorRepresentation, MaterialParameters, ShaderMaterial, Vector2 } from '../../../src/Three.js';

export interface LineMaterialParameters extends MaterialParameters {
alphaToCoverage?: boolean | undefined;
color?: number | undefined;
color?: ColorRepresentation | undefined;
dashed?: boolean | undefined;
dashScale?: number | undefined;
dashSize?: number | undefined;
Expand Down
15 changes: 15 additions & 0 deletions types/three/test/unit/examples/jsm/lines/LineMaterial.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as THREE from 'three';

import { LineMaterial } from 'three/examples/jsm/lines/LineMaterial';

const color1 = new LineMaterial({
color: new THREE.Color('blue'),
});

const color2 = new LineMaterial({
color: 'red',
});

const color3 = new LineMaterial({
color: 0xaabbcc,
});
1 change: 1 addition & 0 deletions types/three/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"test/unit/examples/jsm/helpers/ViewHelper.ts",
"test/unit/examples/jsm/libs/lil-gui.ts",
"test/unit/examples/jsm/libs/tween.ts",
"test/unit/examples/jsm/lines/LineMaterial.ts",
"test/unit/examples/jsm/nodes/core/FunctionNode.ts",
"test/unit/examples/jsm/nodes/display/ColorAdjustmentNode.ts",
"test/unit/examples/jsm/nodes/materials/lib/mx_noise.ts",
Expand Down

0 comments on commit 171c6c5

Please sign in to comment.