Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions types/three/src/nodes/core/MRTNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ColorRepresentation } from "../../math/Color.js";
import BlendMode from "../../renderers/common/BlendMode.js";
import Color4 from "../../renderers/common/Color4.js";
import { Texture } from "../../textures/Texture.js";
import { Node } from "../Nodes.js";
import OutputStructNode from "./OutputStructNode.js";
Expand All @@ -10,6 +12,8 @@ declare class MRTNode extends OutputStructNode {

blendModes: { [name: string]: BlendMode };

clearColors: { [name: string]: Color4 };

readonly isMRTNode: true;

constructor(outputNodes: { [name: string]: Node });
Expand All @@ -18,6 +22,10 @@ declare class MRTNode extends OutputStructNode {

getBlendMode(name: string): BlendMode;

setClearColor(name: string, color: ColorRepresentation, alpha?: number): this;

getClearColor(name: string): Color4 | null;

has(name: string): boolean;

get: (name: string) => Node;
Expand Down
53 changes: 53 additions & 0 deletions types/three/src/renderers/common/Color4.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Color, ColorRepresentation } from "../../math/Color.js";

/**
* A four-component version of {@link Color} which is internally
* used by the renderer to represents clear color with alpha as
* one object.
*
* @private
*/
declare class Color4 extends Color {
/**
* The alpha value.
*/
a: number;

/**
* Constructs a new four-component color.
* You can also pass a single THREE.Color, hex or
* string argument to this constructor.
*
* @param r - The red value.
* @param g - The green value.
* @param b - The blue value.
* @param a - The alpha value.
*/
constructor(r?: ColorRepresentation, g?: number, b?: number, a?: number);

/**
* Overwrites the default to honor alpha.
* You can also pass a single THREE.Color, hex or
* string argument to this method.
*/
set(...args: [color: ColorRepresentation] | [r: number, g: number, b: number, a?: number]): this;

/**
* Overwrites the default to honor alpha.
*
* @param color - The color to copy.
* @return A reference to this object.
*/
copy(color: Color4): this;

/**
* Overwrites the default to honor alpha.
*
* @return The cloned color.
*/
clone(): this;

[Symbol.iterator](): Generator<number, void>;
}

export default Color4;
Loading