xr-frame / Exports / Color

# Class: Color

# Table of contents

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

new Color(r?, g?, b?, a?)

# Parameters

Name Type
r? number
g? number
b? number
a? number

# Properties

# BlendType

Static BlendType: typeof BlendType

# Accessors

# a

get a(): number

# Returns

number

set a(val): void

# Parameters

Name Type
val number

# Returns

void


# b

get b(): number

# Returns

number

set b(val): void

# Parameters

Name Type
val number

# Returns

void


# g

get g(): number

# Returns

number

set g(val): void

# Parameters

Name Type
val number

# Returns

void


# r

get r(): number

# Returns

number

set r(val): void

# Parameters

Name Type
val number

# Returns

void


# BLACK

Static get BLACK(): Color

# Returns

Color


# TRANSPARENT

Static get TRANSPARENT(): Color

# Returns

Color


# WHITE

Static get WHITE(): Color

# Returns

Color

# Methods

# clone

clone(): Color

# Returns

Color


# equals

equals(target): boolean

# Parameters

Name Type
target Color

# Returns

boolean


# mix

mix(color, dst?): Color

# Parameters

Name Type
color Color
dst? Color

# Returns

Color


# set

set(val): void

# Parameters

Name Type
val Color

# Returns

void


# setRGBA

setRGBA(r, g, b, a): void

# Parameters

Name Type
r number
g number
b number
a number

# Returns

void


# setValue32

setValue32(v32): void

# Parameters

Name Type
v32 number

# Returns

void


# toNormalizedArray

toNormalizedArray(): [number, number, number, number]

# Returns

[number, number, number, number]


# toRGBAString

toRGBAString(): string

# Returns

string


# blendColorHex

Static blendColorHex(colorHexA, colorHexB, type?): number

# Parameters

Name Type
colorHexA number
colorHexB number
type BlendType

# Returns

number


# diffc

Static diffc(v, c, diff): number

# Parameters

Name Type
v number
c number
diff number

# Returns

number


# fromFloatArray

Static fromFloatArray(arr): Color

# Parameters

Name Type
arr number[]

# Returns

Color


# fromHex

Static fromHex(hex): Color

# Parameters

Name Type
hex number

# Returns

Color


# fromHexString

Static fromHexString(hexString): Color

# Parameters

Name Type
hexString string

# Returns

Color


# getValue32FromHSVA

Static getValue32FromHSVA(): void

# Returns

void


# getValue32FromRGBA

Static getValue32FromRGBA(r, g, b, a): number

# Parameters

Name Type
r number
g number
b number
a number

# Returns

number


# hsvV2rgb

Static hsvV2rgb(h, s, v, dst?): Vector3

# Parameters

Name Type
h number
s number
v number
dst? Vector3

# Returns

Vector3


# multiplyColorHex

Static multiplyColorHex(colorHexA, colorHexB, type?): number

# Parameters

Name Type
colorHexA number
colorHexB number
type BlendType

# Returns

number


# percentRoundFn

Static percentRoundFn(num): number

# Parameters

Name Type
num number

# Returns

number


# randomMix

Static randomMix(colorHexA, colorHexB, randomSeed?): number

# Parameters

Name Type
colorHexA number
colorHexB number
randomSeed number

# Returns

number


# rgb2hsv

Static rgb2hsv(r, g, b, dst?): Vector3

# Parameters

Name Type
r number
g number
b number
dst? Vector3

# Returns

Vector3