| Name | Type | Default | Description |
|---|---|---|---|
red |
number |
1.0
|
optional The red component. |
green |
number |
1.0
|
optional The green component. |
blue |
number |
1.0
|
optional The blue component. |
alpha |
number |
1.0
|
optional The alpha component. |
See:
Members
static constant Cesium.Color.ALICEBLUE : Color
初始化为CSS颜色 #F0F8FF
static constant Cesium.Color.ANTIQUEWHITE : Color
初始化为CSS颜色 #FAEBD7
static constant Cesium.Color.AQUA : Color
初始化为CSS颜色 #00FFFF
static constant Cesium.Color.AQUAMARINE : Color
初始化为CSS颜色 #7FFFD4
static constant Cesium.Color.AZURE : Color
初始化为CSS颜色 #F0FFFF
static constant Cesium.Color.BEIGE : Color
初始化为CSS颜色 #F5F5DC
static constant Cesium.Color.BISQUE : Color
初始化为CSS颜色 #FFE4C4
static constant Cesium.Color.BLACK : Color
初始化为CSS颜色 #000000
static constant Cesium.Color.BLANCHEDALMOND : Color
初始化为CSS颜色 #FFEBCD
static constant Cesium.Color.BLUE : Color
初始化为CSS颜色 #0000FF
static constant Cesium.Color.BLUEVIOLET : Color
初始化为CSS颜色 #8A2BE2
static constant Cesium.Color.BROWN : Color
初始化为CSS颜色 #A52A2A
static constant Cesium.Color.BURLYWOOD : Color
初始化为CSS颜色 #DEB887
static constant Cesium.Color.CADETBLUE : Color
初始化为CSS颜色 #5F9EA0
static constant Cesium.Color.CHARTREUSE : Color
初始化为CSS颜色 #7FFF00
static constant Cesium.Color.CHOCOLATE : Color
初始化为CSS颜色 #D2691E
static constant Cesium.Color.CORAL : Color
初始化为CSS颜色 #FF7F50
static constant Cesium.Color.CORNFLOWERBLUE : Color
初始化为CSS颜色 #6495ED
static constant Cesium.Color.CORNSILK : Color
初始化为CSS颜色 #FFF8DC
static constant Cesium.Color.CRIMSON : Color
初始化为CSS颜色 #DC143C
static constant Cesium.Color.CYAN : Color
初始化为CSS颜色 #00FFFF
static constant Cesium.Color.DARKBLUE : Color
初始化为CSS颜色 #00008B
static constant Cesium.Color.DARKCYAN : Color
初始化为CSS颜色 #008B8B
static constant Cesium.Color.DARKGOLDENROD : Color
初始化为CSS颜色 #B8860B
static constant Cesium.Color.DARKGRAY : Color
初始化为CSS颜色 #A9A9A9
static constant Cesium.Color.DARKGREEN : Color
初始化为CSS颜色 #006400
static constant Cesium.Color.DARKGREY : Color
初始化为CSS颜色 #A9A9A9
static constant Cesium.Color.DARKKHAKI : Color
初始化为CSS颜色 #BDB76B
static constant Cesium.Color.DARKMAGENTA : Color
初始化为CSS颜色 #8B008B
static constant Cesium.Color.DARKOLIVEGREEN : Color
初始化为CSS颜色 #556B2F
static constant Cesium.Color.DARKORANGE : Color
初始化为CSS颜色 #FF8C00
static constant Cesium.Color.DARKORCHID : Color
初始化为CSS颜色 #9932CC
static constant Cesium.Color.DARKRED : Color
初始化为CSS颜色 #8B0000
static constant Cesium.Color.DARKSALMON : Color
初始化为CSS颜色 #E9967A
static constant Cesium.Color.DARKSEAGREEN : Color
初始化为CSS颜色 #8FBC8F
static constant Cesium.Color.DARKSLATEBLUE : Color
初始化为CSS颜色 #483D8B
static constant Cesium.Color.DARKSLATEGRAY : Color
初始化为CSS颜色 #2F4F4F
static constant Cesium.Color.DARKSLATEGREY : Color
初始化为CSS颜色 #2F4F4F
static constant Cesium.Color.DARKTURQUOISE : Color
初始化为CSS颜色 #00CED1
static constant Cesium.Color.DARKVIOLET : Color
初始化为CSS颜色 #9400D3
static constant Cesium.Color.DEEPPINK : Color
初始化为CSS颜色 #FF1493
static constant Cesium.Color.DEEPSKYBLUE : Color
初始化为CSS颜色 #00BFFF
static constant Cesium.Color.DIMGRAY : Color
初始化为CSS颜色 #696969
static constant Cesium.Color.DIMGREY : Color
初始化为CSS颜色 #696969
static constant Cesium.Color.DODGERBLUE : Color
初始化为CSS颜色 #1E90FF
static constant Cesium.Color.FIREBRICK : Color
初始化为CSS颜色 #B22222
static constant Cesium.Color.FLORALWHITE : Color
初始化为CSS颜色 #FFFAF0
static constant Cesium.Color.FORESTGREEN : Color
初始化为CSS颜色 #228B22
static constant Cesium.Color.FUCHSIA : Color
初始化为CSS颜色 #FF00FF
static constant Cesium.Color.GAINSBORO : Color
初始化为CSS颜色 #DCDCDC
static constant Cesium.Color.GHOSTWHITE : Color
初始化为CSS颜色 #F8F8FF
static constant Cesium.Color.GOLD : Color
初始化为CSS颜色 #FFD700
static constant Cesium.Color.GOLDENROD : Color
初始化为CSS颜色 #DAA520
static constant Cesium.Color.GRAY : Color
初始化为CSS颜色 #808080
static constant Cesium.Color.GREEN : Color
初始化为CSS颜色 #008000
static constant Cesium.Color.GREENYELLOW : Color
初始化为CSS颜色 #ADFF2F
static constant Cesium.Color.GREY : Color
初始化为CSS颜色 #808080
static constant Cesium.Color.HONEYDEW : Color
初始化为CSS颜色 #F0FFF0
static constant Cesium.Color.HOTPINK : Color
初始化为CSS颜色 #FF69B4
static constant Cesium.Color.INDIANRED : Color
初始化为CSS颜色 #CD5C5C
static constant Cesium.Color.INDIGO : Color
初始化为CSS颜色 #4B0082
static constant Cesium.Color.IVORY : Color
初始化为CSS颜色 #FFFFF0
static constant Cesium.Color.KHAKI : Color
初始化为CSS颜色 #F0E68C
static constant Cesium.Color.LAVENDAR_BLUSH : Color
初始化为CSS颜色 #FFF0F5
static constant Cesium.Color.LAVENDER : Color
初始化为CSS颜色 #E6E6FA
static constant Cesium.Color.LAWNGREEN : Color
初始化为CSS颜色 #7CFC00
static constant Cesium.Color.LEMONCHIFFON : Color
初始化为CSS颜色 #FFFACD
static constant Cesium.Color.LIGHTBLUE : Color
初始化为CSS颜色 #ADD8E6
static constant Cesium.Color.LIGHTCORAL : Color
初始化为CSS颜色 #F08080
static constant Cesium.Color.LIGHTCYAN : Color
初始化为CSS颜色 #E0FFFF
static constant Cesium.Color.LIGHTGOLDENRODYELLOW : Color
初始化为CSS颜色 #FAFAD2
static constant Cesium.Color.LIGHTGRAY : Color
初始化为CSS颜色 #D3D3D3
static constant Cesium.Color.LIGHTGREEN : Color
初始化为CSS颜色 #90EE90
static constant Cesium.Color.LIGHTGREY : Color
初始化为CSS颜色 #D3D3D3
static constant Cesium.Color.LIGHTPINK : Color
初始化为CSS颜色 #FFB6C1
static constant Cesium.Color.LIGHTSEAGREEN : Color
初始化为CSS颜色 #20B2AA
static constant Cesium.Color.LIGHTSKYBLUE : Color
初始化为CSS颜色 #87CEFA
static constant Cesium.Color.LIGHTSLATEGRAY : Color
初始化为CSS颜色 #778899
static constant Cesium.Color.LIGHTSLATEGREY : Color
初始化为CSS颜色 #778899
static constant Cesium.Color.LIGHTSTEELBLUE : Color
初始化为CSS颜色 #B0C4DE
static constant Cesium.Color.LIGHTYELLOW : Color
初始化为CSS颜色 #FFFFE0
static constant Cesium.Color.LIME : Color
初始化为CSS颜色 #00FF00
static constant Cesium.Color.LIMEGREEN : Color
初始化为CSS颜色 #32CD32
static constant Cesium.Color.LINEN : Color
初始化为CSS颜色 #FAF0E6
static constant Cesium.Color.MAGENTA : Color
初始化为CSS颜色 #FF00FF
static constant Cesium.Color.MAROON : Color
初始化为CSS颜色 #800000
static constant Cesium.Color.MEDIUMAQUAMARINE : Color
初始化为CSS颜色 #66CDAA
static constant Cesium.Color.MEDIUMBLUE : Color
初始化为CSS颜色 #0000CD
static constant Cesium.Color.MEDIUMORCHID : Color
初始化为CSS颜色 #BA55D3
static constant Cesium.Color.MEDIUMPURPLE : Color
初始化为CSS颜色 #9370DB
static constant Cesium.Color.MEDIUMSEAGREEN : Color
初始化为CSS颜色 #3CB371
static constant Cesium.Color.MEDIUMSLATEBLUE : Color
初始化为CSS颜色 #7B68EE
static constant Cesium.Color.MEDIUMSPRINGGREEN : Color
初始化为CSS颜色 #00FA9A
static constant Cesium.Color.MEDIUMTURQUOISE : Color
初始化为CSS颜色 #48D1CC
static constant Cesium.Color.MEDIUMVIOLETRED : Color
初始化为CSS颜色 #C71585
static constant Cesium.Color.MIDNIGHTBLUE : Color
初始化为CSS颜色 #191970
static constant Cesium.Color.MINTCREAM : Color
初始化为CSS颜色 #F5FFFA
static constant Cesium.Color.MISTYROSE : Color
初始化为CSS颜色 #FFE4E1
static constant Cesium.Color.MOCCASIN : Color
初始化为CSS颜色 #FFE4B5
static constant Cesium.Color.NAVAJOWHITE : Color
初始化为CSS颜色 #FFDEAD
static constant Cesium.Color.NAVY : Color
初始化为CSS颜色 #000080
static constant Cesium.Color.OLDLACE : Color
初始化为CSS颜色 #FDF5E6
static constant Cesium.Color.OLIVE : Color
初始化为CSS颜色 #808000
static constant Cesium.Color.OLIVEDRAB : Color
初始化为CSS颜色 #6B8E23
static constant Cesium.Color.ORANGE : Color
初始化为CSS颜色 #FFA500
static constant Cesium.Color.ORANGERED : Color
初始化为CSS颜色 #FF4500
static constant Cesium.Color.ORCHID : Color
初始化为CSS颜色 #DA70D6
The number of elements used to pack the object into an array.
static constant Cesium.Color.PALEGOLDENROD : Color
初始化为CSS颜色 #EEE8AA
static constant Cesium.Color.PALEGREEN : Color
初始化为CSS颜色 #98FB98
static constant Cesium.Color.PALETURQUOISE : Color
初始化为CSS颜色 #AFEEEE
static constant Cesium.Color.PALEVIOLETRED : Color
初始化为CSS颜色 #DB7093
static constant Cesium.Color.PAPAYAWHIP : Color
初始化为CSS颜色 #FFEFD5
static constant Cesium.Color.PEACHPUFF : Color
初始化为CSS颜色 #FFDAB9
static constant Cesium.Color.PERU : Color
初始化为CSS颜色 #CD853F
static constant Cesium.Color.PINK : Color
初始化为CSS颜色 #FFC0CB
static constant Cesium.Color.PLUM : Color
初始化为CSS颜色 #DDA0DD
static constant Cesium.Color.POWDERBLUE : Color
初始化为CSS颜色 #B0E0E6
static constant Cesium.Color.PURPLE : Color
初始化为CSS颜色 #800080
static constant Cesium.Color.RED : Color
初始化为CSS颜色 #FF0000
static constant Cesium.Color.ROSYBROWN : Color
初始化为CSS颜色 #BC8F8F
static constant Cesium.Color.ROYALBLUE : Color
初始化为CSS颜色 #4169E1
static constant Cesium.Color.SADDLEBROWN : Color
初始化为CSS颜色 #8B4513
static constant Cesium.Color.SALMON : Color
初始化为CSS颜色 #FA8072
static constant Cesium.Color.SANDYBROWN : Color
初始化为CSS颜色 #F4A460
static constant Cesium.Color.SEAGREEN : Color
初始化为CSS颜色 #2E8B57
static constant Cesium.Color.SEASHELL : Color
初始化为CSS颜色 #FFF5EE
static constant Cesium.Color.SIENNA : Color
初始化为CSS颜色 #A0522D
static constant Cesium.Color.SILVER : Color
初始化为CSS颜色 #C0C0C0
static constant Cesium.Color.SKYBLUE : Color
初始化为CSS颜色 #87CEEB
static constant Cesium.Color.SLATEBLUE : Color
初始化为CSS颜色 #6A5ACD
static constant Cesium.Color.SLATEGRAY : Color
初始化为CSS颜色 #708090
static constant Cesium.Color.SLATEGREY : Color
初始化为CSS颜色 #708090
static constant Cesium.Color.SNOW : Color
初始化为CSS颜色 #FFFAFA
static constant Cesium.Color.SPRINGGREEN : Color
初始化为CSS颜色 #00FF7F
static constant Cesium.Color.STEELBLUE : Color
初始化为CSS颜色 #4682B4
static constant Cesium.Color.TAN : Color
初始化为CSS颜色 #D2B48C
static constant Cesium.Color.TEAL : Color
初始化为CSS颜色 #008080
static constant Cesium.Color.THISTLE : Color
初始化为CSS颜色 #D8BFD8
static constant Cesium.Color.TOMATO : Color
初始化为CSS颜色 #FF6347
static constant Cesium.Color.TRANSPARENT : Color
An immutable Color instance initialized to CSS transparent.
static constant Cesium.Color.TURQUOISE : Color
初始化为CSS颜色 #40E0D0
static constant Cesium.Color.VIOLET : Color
初始化为CSS颜色 #EE82EE
static constant Cesium.Color.WHEAT : Color
初始化为CSS颜色 #F5DEB3
static constant Cesium.Color.WHITE : Color
初始化为CSS颜色 #FFFFFF
static constant Cesium.Color.WHITESMOKE : Color
初始化为CSS颜色 #F5F5F5
static constant Cesium.Color.YELLOW : Color
初始化为CSS颜色 #FFFF00
static constant Cesium.Color.YELLOWGREEN : Color
初始化为CSS颜色 #9ACD32
alpha分量。
-
Default Value:
1.0
蓝色分量。
-
Default Value:
1.0
绿色分量。
-
Default Value:
1.0
红色分量。
-
Default Value:
1.0
Methods
static Cesium.Color.add(left, right, result) → Color
计算两个Color的逐分量之和。
| Name | Type | Description |
|---|---|---|
left |
Color | 第一个Color。 |
right |
Color | 第二个Color。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
使用系统的字节序,将字节形式的RGBA值转换为单个32位无符号RGBA数值。
Returns:
单个32位无符号RGBA数值。
- Color.toRgba
See:
将范围为0到255的'字节'颜色分量转换为
范围为0到1.0的'浮点'颜色分量。
| Name | Type | Description |
|---|---|---|
number |
number | 要转换的数值。 |
Returns:
转换后的数值。
static Cesium.Color.clone(color, result) → Color
复制一个Color实例。
| Name | Type | Description |
|---|---|---|
color |
Color | 要复制的Color。 |
result |
Color | optional 存储结果的对象,如果未定义则创建新实例。 |
Returns:
修改后的结果参数,如果未提供结果则返回新实例(如果color未定义则返回undefined)。
static Cesium.Color.divide(left, right, result) → Color
计算两个Color的逐分量商。
| Name | Type | Description |
|---|---|---|
left |
Color | 第一个Color。 |
right |
Color | 第二个Color。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Color.divideByScalar(color, scalar, result) → Color
将提供的Color逐分量除以提供的标量。
| Name | Type | Description |
|---|---|---|
color |
Color | 要被除的Color。 |
scalar |
number | 用来相除的标量。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
判断第一个Color是否等于第二个Color。
| Name | Type | Description |
|---|---|---|
left |
Color | optional 要比较的第一个Color。 |
right |
Color | optional 要比较的第二个Color。 |
Returns:
如果Color相等则返回
true,否则返回false。
将范围为0到1.0的'浮点'颜色分量转换为
范围为0到255的'字节'颜色分量。
| Name | Type | Description |
|---|---|---|
number |
number | 要转换的数值。 |
Returns:
转换后的数值。
static Cesium.Color.fromAlpha(color, alpha, result) → Color
创建一个新颜色,具有与指定颜色相同的红色、绿色和蓝色分量,
但使用指定的alpha值。
| Name | Type | Description |
|---|---|---|
color |
Color | 基础颜色 |
alpha |
number | 新的alpha分量。 |
result |
Color | optional 存储结果的对象。 |
Returns:
修改后的结果参数;如果未提供则返回新的Color实例。
Example:
const translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
static Cesium.Color.fromBytes(red, green, blue, alpha, result) → Color
使用红色、绿色、蓝色和alpha值创建新颜色,
这些值在0到255范围内,内部转换为0.0到1.0的范围。
| Name | Type | Default | Description |
|---|---|---|---|
red |
number |
255
|
optional 红色分量。 |
green |
number |
255
|
optional 绿色分量。 |
blue |
number |
255
|
optional 蓝色分量。 |
alpha |
number |
255
|
optional alpha分量。 |
result |
Color | optional 存储结果的对象。 |
Returns:
修改后的结果参数;如果未提供则返回新的Color实例。
static Cesium.Color.fromCartesian4(cartesian, result) → Color
| Name | Type | Description |
|---|---|---|
cartesian |
Cartesian4 | 源笛卡尔坐标。 |
result |
Color | optional 存储结果的对象。 |
Returns:
修改后的结果参数;如果未提供则返回新的Color实例。
static Cesium.Color.fromCssColorString(color, result) → Color
从CSS颜色值创建Color实例。
| Name | Type | Description |
|---|---|---|
color |
string | CSS颜色值,格式为#rgb、#rgba、#rrggbb、#rrggbbaa、rgb()、rgba()、hsl()或hsla()。 |
result |
Color | optional 存储结果的对象,如果未定义则创建新实例。 |
Returns:
颜色对象,如果字符串不是有效的CSS颜色则返回undefined。
Example:
const cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
const green = Cesium.Color.fromCssColorString('green');
See:
static Cesium.Color.fromHsl(hue, saturation, lightness, alpha, result) → Color
从色相、饱和度和亮度创建Color实例。
| Name | Type | Default | Description |
|---|---|---|---|
hue |
number |
0
|
optional 色相角度 0...1 |
saturation |
number |
0
|
optional 饱和度值 0...1 |
lightness |
number |
0
|
optional 亮度值 0...1 |
alpha |
number |
1.0
|
optional alpha分量 0...1 |
result |
Color | optional 存储结果的对象,如果未定义则创建新实例。 |
Returns:
颜色对象。
See:
static Cesium.Color.fromRandom(options, result) → Color
使用提供的选项创建随机颜色。为了获得可复现的随机颜色,应在应用程序开始时
调用
CesiumMath#setRandomNumberSeed。
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
包含以下属性的对象:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
result |
Color | optional 存储结果的对象,如果未定义则创建新实例。 |
Returns:
修改后的结果参数或新实例(如果未提供result)。
Throws:
-
DeveloperError : minimumRed必须小于或等于maximumRed。
-
DeveloperError : minimumGreen必须小于或等于maximumGreen。
-
DeveloperError : minimumBlue必须小于或等于maximumBlue。
-
DeveloperError : minimumAlpha必须小于或等于maximumAlpha。
Example:
//创建一个完全随机的颜色
const color = Cesium.Color.fromRandom();
//创建一个随机的黄色阴影。
const color1 = Cesium.Color.fromRandom({
red : 1.0,
green : 1.0,
alpha : 1.0
});
//创建一个随机的亮色。
const color2 = Cesium.Color.fromRandom({
minimumRed : 0.75,
minimumGreen : 0.75,
minimumBlue : 0.75,
alpha : 1.0
});
static Cesium.Color.fromRgba(rgba, result) → Color
从单个32位无符号RGBA数值创建新颜色,使用系统的字节序。
| Name | Type | Description |
|---|---|---|
rgba |
number | 单个32位无符号RGBA数值。 |
result |
Color | optional 存储结果的对象,如果未定义则创建新实例。 |
Returns:
颜色对象。
Example:
const color = Cesium.Color.fromRgba(0x67ADDFFF);
See:
static Cesium.Color.lerp(start, end, t, result) → Color
Computes the linear interpolation or extrapolation at t between the provided colors.
| Name | Type | Description |
|---|---|---|
start |
Color | The color corresponding to t at 0.0. |
end |
Color | The color corresponding to t at 1.0. |
t |
number | The point along t at which to interpolate. |
result |
Color | The object onto which to store the result. |
Returns:
The modified result parameter.
static Cesium.Color.mod(left, right, result) → Color
Computes the componentwise modulus of two Colors.
| Name | Type | Description |
|---|---|---|
left |
Color | The first Color. |
right |
Color | The second Color. |
result |
Color | The object onto which to store the result. |
Returns:
The modified result parameter.
static Cesium.Color.multiply(left, right, result) → Color
计算两个Color的逐分量乘积。
| Name | Type | Description |
|---|---|---|
left |
Color | 第一个Color。 |
right |
Color | 第二个Color。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Color.multiplyByScalar(color, scalar, result) → Color
将提供的Color逐分量乘以提供的标量。
| Name | Type | Description |
|---|---|---|
color |
Color | 要缩放的Color。 |
scalar |
number | 要相乘的标量。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Color.pack(value, array, startingIndex) → Array.<number>|TypedArray
将提供的实例存储到提供的数组中。
| Name | Type | Default | Description |
|---|---|---|---|
value |
Color | 要打包的值。 | |
array |
Array.<number> | TypedArray | 要打包到的数组。 | |
startingIndex |
number |
0
|
optional 开始打包元素的数组索引。 |
Returns:
被打包到的数组
static Cesium.Color.subtract(left, right, result) → Color
计算两个Color的逐分量之差。
| Name | Type | Description |
|---|---|---|
left |
Color | 第一个Color。 |
right |
Color | 第二个Color。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
static Cesium.Color.unpack(array, startingIndex, result) → Color
从打包数组中检索实例。
| Name | Type | Default | Description |
|---|---|---|---|
array |
Array.<number> | TypedArray | 打包数组。 | |
startingIndex |
number |
0
|
optional 要解包元素的起始索引。 |
result |
Color | optional 存储结果的对象。 |
Returns:
修改后的结果参数,如果未提供则创建新的Color实例。
brighten(magnitude, result) → Color
按提供的量增亮此颜色。
| Name | Type | Description |
|---|---|---|
magnitude |
number | 指示增亮量的正数。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
Example:
const brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
clone(result) → Color
返回当前Color实例的副本。
| Name | Type | Description |
|---|---|---|
result |
Color | optional 存储结果的对象,如果未定义则创建新实例。 |
Returns:
修改后的结果参数,如果未提供结果则返回新实例。
darken(magnitude, result) → Color
按提供的量变暗此颜色。
| Name | Type | Description |
|---|---|---|
magnitude |
number | 指示变暗量的正数。 |
result |
Color | 存储结果的对象。 |
Returns:
修改后的结果参数。
Example:
const darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
判断当前Color是否等于另一个Color。
| Name | Type | Description |
|---|---|---|
other |
Color | optional 要比较的Color。 |
Returns:
如果Color相等则返回
true,否则返回false。
判断当前Color是否在指定的误差范围内与另一个Color逐分量相等。
| Name | Type | Default | Description |
|---|---|---|---|
other |
Color | 要比较的Color。 | |
epsilon |
number |
0.0
|
optional 用于相等性测试的误差值。 |
Returns:
如果在指定误差范围内Color相等则返回
true,否则返回false。
将此颜色转换为红、绿、蓝和alpha值组成的数组,范围为0到255。
| Name | Type | Description |
|---|---|---|
result |
Array.<number> | optional 存储结果的数组,如果未定义则创建新实例。 |
Returns:
修改后的结果参数,如果未提供结果则返回新实例。
创建包含此颜色CSS颜色值的字符串。
Returns:
此颜色的CSS等效值。
See:
创建包含此颜色CSS十六进制字符串值的字符串。
Returns:
此颜色的CSS十六进制字符串等效值。
使用系统的字节序,将此颜色转换为单个32位无符号RGBA数值。
Returns:
单个32位无符号RGBA数值。
Example:
const rgba = Cesium.Color.BLUE.toRgba();
See:
创建表示此Color的字符串,格式为'(red, green, blue, alpha)'。
Returns:
表示此Color的字符串,格式为'(red, green, blue, alpha)'。
withAlpha(alpha, result) → Color
Creates a new Color that has the same red, green, and blue components
as this Color, but with the specified alpha value.
| Name | Type | Description |
|---|---|---|
alpha |
number | The new alpha component. |
result |
Color | optional The object onto which to store the result. |
Returns:
The modified result parameter or a new Color instance if one was not provided.
Example:
const translucentRed = Cesium.Color.RED.withAlpha(0.9);
