Home Reference Source
import {Color} from './stdlib/color.js'
public class | source

Color

Represents a color in the Source Engine

Static Method Summary

Static Public Methods
public static

Claps the value to the valid range [0-255]

public static

parse(data: string): Color

Parse a Color object from a string

Constructor Summary

Public Constructor
public

Creates an empty color

Member Summary

Public Members
public get

a: number: *

The alpha component

public set

a(value: number): *

Sets the alpha component

public get

b: number: *

The blue component

public set

b(value: number): *

Sets the blue component

public get

g: number: *

The green component

public set

g(value: number): *

Sets the green component

public get

r: number: *

The red component

public set

r(value: number): *

Sets the red component

public get

The name of the lookup key in the schema file

public set

Method Summary

Public Methods
public

toString(): *

Static Public Methods

public static clamp(i: number): number source

Claps the value to the valid range [0-255]

Params:

NameTypeAttributeDescription
i number

Return:

number

public static parse(data: string): Color source

Parse a Color object from a string

Params:

NameTypeAttributeDescription
data string

The data to parse

Return:

Color

Public Constructors

public constructor source

Creates an empty color

Public Members

public get a: number: * source

The alpha component

Return:

number

public set a(value: number): * source

Sets the alpha component

public get b: number: * source

The blue component

Return:

number

public set b(value: number): * source

Sets the blue component

public get g: number: * source

The green component

Return:

number

public set g(value: number): * source

Sets the green component

public get r: number: * source

The red component

Return:

number

public set r(value: number): * source

Sets the red component

public get schemaKey: string: * source

The name of the lookup key in the schema file

Return:

string

public set schemaKey: string source

Public Methods

public toString(): * source

Return:

*