1- [ /authoring-api ] ( ../overview.md ) / Color
1+ [ @ hz/add-on-hz-hlapi-sdk ] ( ../overview.md ) / Color
22
33# Class: Color
44
55Represents a color in one of any available RGB colorspaces.
66
7- ## Table of contents
7+ ## Hierarchy
8+
9+ - ` ProxyLiveObject `
810
9- ### Constructors
11+ ↳ ** ` Color ` **
1012
11- - [ constructor ] ( Color.md#constructor )
13+ ## Table of contents
1214
13- ### Properties
15+ ### Accessors
1416
1517- [ alpha] ( Color.md#alpha )
1618- [ blue] ( Color.md#blue )
@@ -21,91 +23,87 @@ Represents a color in one of any available RGB colorspaces.
2123### Methods
2224
2325- [ getHex] ( Color.md#getHex )
24- - [ getIntegerComponents] ( Color.md#getIntegerComponents )
2526- [ createFromHex] ( Color.md#createFromHex )
2627
27- ## Constructors
28-
29- ### <a id =" constructor " name =" constructor " ></a > constructor
30-
31- • ** new Color** (` red ` , ` green ` , ` blue ` , ` alpha? ` )
32-
33- Create a new Color. All color components should be in a 0 - 1 range. Non-finite
34- values are treated as 0. Any values outside this range are clamped to within the
35- range.
36-
37- #### Parameters
38-
39- | Name | Type | Default value | Description |
40- | :------ | :------ | :------ | :------ |
41- | ` red ` | ` number ` | ` undefined ` | The red component in a range from 0 - 1. |
42- | ` green ` | ` number ` | ` undefined ` | The green component in a range from 0 - 1. |
43- | ` blue ` | ` number ` | ` undefined ` | The blue component in a range from 0 - 1. |
44- | ` alpha ` | ` number ` | ` 1 ` | (optional) The alpha component in a range from 0 - 1. |
45-
46- #### Defined in
47-
48- platform/authoring/api/src/Color.ts:69
49-
50- ## Properties
28+ ## Accessors
5129
5230### <a id =" alpha " name =" alpha " ></a > alpha
5331
54- • ` Readonly ` ** alpha** : ` number `
32+ • ` get ` ** alpha** () : ` number `
5533
5634The alpha channel in range from 0 - 1.
5735
36+ #### Returns
37+
38+ ` number `
39+
5840#### Defined in
5941
60- platform/authoring/api/src/ Color.ts:52
42+ Color.ts:59
6143
6244___
6345
6446### <a id =" blue " name =" blue " ></a > blue
6547
66- • ` Readonly ` ** blue** : ` number `
48+ • ` get ` ** blue** () : ` number `
6749
6850The blue channel in range from 0 - 1.
6951
52+ #### Returns
53+
54+ ` number `
55+
7056#### Defined in
7157
72- platform/authoring/api/src/ Color.ts:47
58+ Color.ts:51
7359
7460___
7561
7662### <a id =" colorSpace " name =" colorSpace " ></a > colorSpace
7763
78- • ` Readonly ` ** colorSpace** : [ ` sRGB ` ] ( ../enums/ColorSpace.md#sRGB ) = ` ColorSpace. sRGB`
64+ • ` get ` ** colorSpace** (): ` sRGB `
7965
8066This color's color space. Currently only sRGB is supported.
8167
68+ #### Returns
69+
70+ ` sRGB `
71+
8272#### Defined in
8373
84- platform/authoring/api/src/ Color.ts:57
74+ Color.ts:67
8575
8676___
8777
8878### <a id =" green " name =" green " ></a > green
8979
90- • ` Readonly ` ** green** : ` number `
80+ • ` get ` ** green** () : ` number `
9181
9282The green channel in range from 0 - 1.
9383
84+ #### Returns
85+
86+ ` number `
87+
9488#### Defined in
9589
96- platform/authoring/api/src/ Color.ts:42
90+ Color.ts:43
9791
9892___
9993
10094### <a id =" red " name =" red " ></a > red
10195
102- • ` Readonly ` ** red** : ` number `
96+ • ` get ` ** red** () : ` number `
10397
10498The red channel in range from 0 - 1.
10599
100+ #### Returns
101+
102+ ` number `
103+
106104#### Defined in
107105
108- platform/authoring/api/src/ Color.ts:37
106+ Color.ts:35
109107
110108## Methods
111109
@@ -123,28 +121,7 @@ conversion.
123121
124122#### Defined in
125123
126- platform/authoring/api/src/Color.ts:103
127-
128- ___
129-
130- ### <a id =" getIntegerComponents " name =" getIntegerComponents " ></a > getIntegerComponents
131-
132- ▸ ** getIntegerComponents** (): ` Object `
133-
134- #### Returns
135-
136- ` Object `
137-
138- | Name | Type |
139- | :------ | :------ |
140- | ` alpha ` | ` number ` |
141- | ` blue ` | ` number ` |
142- | ` green ` | ` number ` |
143- | ` red ` | ` number ` |
144-
145- #### Defined in
146-
147- platform/authoring/api/src/Color.ts:122
124+ Color.ts:102
148125
149126___
150127
@@ -171,4 +148,4 @@ the hex string cannot be parsed.
171148
172149#### Defined in
173150
174- platform/authoring/api/src/ Color.ts:92
151+ Color.ts:92
0 commit comments