import { three } from "https://deno.land/x/remapper@2.1.0/src/deps.ts";
const { Color } = three;
Represents a color. See also ColorUtils.
Constructors
new
Color(color?: ColorRepresentation)Methods
addScalar(s: number): this
copyLinearToSRGB(color: Color): Color
Copies given color making conversion from linear to sRGB space.
copySRGBToLinear(color: Color): Color
Copies given color making conversion from sRGB to linear space.
fromArray(array: number[] | ArrayLike<number>, offset?: number): this
Sets this color's red, green and blue value from the provided array or array-like.
fromBufferAttribute(attribute: BufferAttribute, index: number): this
getHexString(colorSpace?: ColorSpace): string
Returns the string formated hexadecimal value of this color.
getHSL(target: HSL, colorSpace?: ColorSpace): HSL
getRGB(target: RGB, colorSpace?: ColorSpace): RGB
getStyle(colorSpace?: ColorSpace): string
Returns the value of this color in CSS context style. Example: rgb(r, g, b)
lerpColors(): this
multiplyScalar(s: number): this
offsetHSL(): this
h: number,
s: number,
l: number,
set(color: ColorRepresentation): Color
setColorName(style: string, colorSpace?: ColorSpace): Color
Sets this color from a color name. Faster than Color#setStyle | .setStyle() method if you don't need the other CSS-style formats.
setHex(hex: number, colorSpace?: ColorSpace): Color
setStyle(style: string, colorSpace?: ColorSpace): Color
Sets this color from a CSS context style string.
toArray(array?: number[], offset?: number): number[]
Returns an array [red, green, blue], or copies red, green and blue into the provided array.
toArray(xyz: ArrayLike<number>, offset?: number): ArrayLike<number>
Copies red, green and blue into the provided array-like.
[Symbol.iterator](): Generator<number, void>