harmony 鸿蒙数据类型说明

  • 2022-08-09
  • 浏览 (1097)

数据类型说明

长度类型

名称 类型定义 描述
length string | number 用于描述尺寸单位,输入为number类型时,使用px单位;输入为string类型时,需要显式指定像素单位,当前支持的像素单位有:
- px:逻辑尺寸单位。
- fp6+:字体尺寸单位,会随系统字体大小设置发生变化,仅支持文本类组件设置相应的字体大小。
percentage string 百分比尺寸单位,如“50%”。

颜色类型

名称 类型定义 描述
color string | 颜色枚举字符串 用于描述颜色信息,JS脚本中不支持颜色枚举格式。
字符串格式如下:
- ‘rgb(255, 255, 255)’
- ‘rgba(255, 255, 255, 1.0)’
- HEX格式:’#rrggbb’,’#aarrggbb’
- 枚举格式:’black’,’white’。

表1 当前支持的颜色枚举

枚举名称 对应颜色 颜色
aliceblue #f0f8ff zh-cn_image_0000001173324803
antiquewhite #faebd7 zh-cn_image_0000001127285014
aqua #00ffff zh-cn_image_0000001127285050
aquamarine #7fffd4 zh-cn_image_0000001173324729
azure #f0ffff zh-cn_image_0000001127285040
beige #f5f5dc zh-cn_image_0000001173324773
bisque #ffe4c4 zh-cn_image_0000001173164895
black #000000 zh-cn_image_0000001173324735
blanchedalmond #ffebcd zh-cn_image_0000001173164889
blue #0000ff zh-cn_image_0000001127125194
blueviolet #8a2be2 zh-cn_image_0000001127285046
brown #a52a2a zh-cn_image_0000001173324833
burlywood #deB887 zh-cn_image_0000001127285026
cadetblue #5f9ea0 zh-cn_image_0000001127125210
chartreuse #7fff00 zh-cn_image_0000001173324811
chocolate #d2691e zh-cn_image_0000001127125256
coral #ff7f50 zh-cn_image_0000001173164877
cornflowerblue #6495ed zh-cn_image_0000001173324781
cornsilk #fff8dc zh-cn_image_0000001127285048
crimson #dc143c zh-cn_image_0000001127285066
cyan #00ffff zh-cn_image_0000001173324789
darkblue #00008b zh-cn_image_0000001173164841
darkcyan #008b8b zh-cn_image_0000001173324745
darkgoldenrod #b8860b zh-cn_image_0000001173324835
darkgray #a9a9a9 zh-cn_image_0000001127285028
darkgreen #006400 zh-cn_image_0000001127284990
darkgrey #a9a9a9 zh-cn_image_0000001127125174
darkkhaki #bdb76b zh-cn_image_0000001127285070
darkmagenta #8b008b zh-cn_image_0000001173164875
darkolivegreen #556b2f zh-cn_image_0000001173164835
darkorange #ff8c00 zh-cn_image_0000001127125178
darkorchid #9932cc zh-cn_image_0000001173324829
darkred #8b0000 zh-cn_image_0000001173164851
darksalmon #e9967a zh-cn_image_0000001127284998
darkseagreen #8fbc8f zh-cn_image_0000001173324755
darkslateblue #483d8b zh-cn_image_0000001127125246
darkslategray #2f4f4f zh-cn_image_0000001127125190
darkslategrey #2f4f4f zh-cn_image_0000001173324759
darkturquoise #00ced1 zh-cn_image_0000001127284980
darkviolet #9400d3 zh-cn_image_0000001127285058
deeppink #ff1493 zh-cn_image_0000001173324767
deepskyblue #00bfff zh-cn_image_0000001173164897
dimgray #696969 zh-cn_image_0000001127285022
dimgrey #696969 zh-cn_image_0000001173164911
dodgerblue #1e90ff zh-cn_image_0000001173164855
firebrick #b22222 zh-cn_image_0000001127125234
floralwhite #fffaf0 zh-cn_image_0000001173324771
forestgreen #228b22 zh-cn_image_0000001173324825
fuchsia #ff00ff zh-cn_image_0000001127285052
gainsboro #dcdcdc zh-cn_image_0000001173164901
ghostwhite #f8f8ff zh-cn_image_0000001127285012
gold #ffd700 zh-cn_image_0000001173324761
goldenrod #daa520 zh-cn_image_0000001173324817
gray #808080 zh-cn_image_0000001127125238
green #008000 zh-cn_image_0000001173164865
greenyellow #adff2f zh-cn_image_0000001127285000
grey #808080 zh-cn_image_0000001127285054
honeydew #f0fff0 zh-cn_image_0000001173324813
hotpink #ff69b4 zh-cn_image_0000001127285016
indianred #cd5c5c zh-cn_image_0000001173164849
indigo #4b0082 zh-cn_image_0000001173324821
ivory #fffff0 zh-cn_image_0000001173164887
khaki #f0e68c zh-cn_image_0000001173324801
lavender #e6e6fa zh-cn_image_0000001127125188
lavenderblush #fff0f5 zh-cn_image_0000001173324809
lawngreen #7cfc00 zh-cn_image_0000001127125224
lemonchiffon #fffacd zh-cn_image_0000001173164879
lightblue #add8e6 zh-cn_image_0000001127125180
lightcoral #f08080 zh-cn_image_0000001127125228
lightcyan #e0ffff zh-cn_image_0000001173324799
lightgoldenrodyellow #fafad2 zh-cn_image_0000001127125218
lightgray #d3d3d3 zh-cn_image_0000001127284974
lightgreen #90ee90 zh-cn_image_0000001173324805
lightpink #ffb6c1 zh-cn_image_0000001127285038
lightsalmon #ffa07a zh-cn_image_0000001173324795
lightseagreen #20b2aa zh-cn_image_0000001173324737
lightskyblue #87cefa zh-cn_image_0000001127285042
lightslategray #778899 zh-cn_image_0000001127125226
lightslategrey #778899 zh-cn_image_0000001127125222
lightsteelblue #b0c4de zh-cn_image_0000001127284976
lightyellow #ffffe0 zh-cn_image_0000001173324807
lime #00ff00 zh-cn_image_0000001127285020
limegreen #32cd32 zh-cn_image_0000001127125236
linen #faf0e6 zh-cn_image_0000001173324739
magenta #ff00ff zh-cn_image_0000001127285044
maroon #800000 zh-cn_image_0000001127285018
mediumaquamarine #66cdaa zh-cn_image_0000001173164899
mediumblue #0000cd zh-cn_image_0000001127284968
mediumorchid #ba55d3 zh-cn_image_0000001127125216
mediumpurple #9370db zh-cn_image_0000001173324779
mediumseagreen #3cb371 zh-cn_image_0000001127125230
mediumslateblue #7b68ee zh-cn_image_0000001173164921
mediumspringgreen #00fa9a zh-cn_image_0000001173324793
mediumturquoise #48d1cc zh-cn_image_0000001127125214
mediumvioletred #c71585 zh-cn_image_0000001173164893
midnightblue #191970 zh-cn_image_0000001127125260
mintcream #f5fffa zh-cn_image_0000001127285030
mistyrose #ffe4e1 zh-cn_image_0000001173324785
moccasin #ffe4b5 zh-cn_image_0000001127125232
navajowhite #ffdead zh-cn_image_0000001173164925
navy #000080 zh-cn_image_0000001127285032
oldlace #fdf5e6 zh-cn_image_0000001127125184
olive #808000 zh-cn_image_0000001127125244
olivedrab #6b8e23 zh-cn_image_0000001173324839
orange #ffa500 zh-cn_image_0000001173164885
orangered #ff4500 zh-cn_image_0000001127284996
orchid #da70d6 zh-cn_image_0000001127285056
palegoldenrod #eee8aa zh-cn_image_0000001127125262
palegreen #98fb98 zh-cn_image_0000001127285006
paleturquoise #afeeee zh-cn_image_0000001173324757
palevioletred #db7093 zh-cn_image_0000001173164905
papayawhip #ffefd5 zh-cn_image_0000001127125248
peachpuff #ffdab9 zh-cn_image_0000001173324769
peru #cd853f zh-cn_image_0000001173164843
pink #ffc0cb zh-cn_image_0000001127125242
plum #dda0dd zh-cn_image_0000001173324831
powderblue #b0e0e6 zh-cn_image_0000001127285010
purple #800080 zh-cn_image_0000001127285002
rebeccapurple #663399 zh-cn_image_0000001173164907
red #ff0000 zh-cn_image_0000001127125254
rosybrown #bc8f8f zh-cn_image_0000001173324775
royalblue #4169e1 zh-cn_image_0000001127284972
saddlebrown #8b4513 zh-cn_image_0000001127125250
salmon #fa8072 zh-cn_image_0000001127285064
sandybrown #f4a460 zh-cn_image_0000001173324777
seagreen #2e8b57 zh-cn_image_0000001173324733
seashell #fff5ee zh-cn_image_0000001127285062
sienna #a0522d zh-cn_image_0000001173164917
silver #c0c0c0 zh-cn_image_0000001173324743
skyblue #87ceeb zh-cn_image_0000001127284970
slateblue #6a5acd zh-cn_image_0000001173164915
slategray #708090 zh-cn_image_0000001173324815
slategrey #708090 zh-cn_image_0000001127284982
snow #fffafa zh-cn_image_0000001173324731
springgreen #00ff7f zh-cn_image_0000001127285060
steelblue #4682b4 zh-cn_image_0000001127125240
tan #d2b48c zh-cn_image_0000001173324747
teal #008080 zh-cn_image_0000001173324741
thistle #d8Bfd8 zh-cn_image_0000001173164913
tomato #ff6347 zh-cn_image_0000001173164909
turquoise #40e0d0 zh-cn_image_0000001173164837
violet #ee82ee zh-cn_image_0000001127125258
wheat #f5deb3 zh-cn_image_0000001127285068
white #ffffff zh-cn_image_0000001173324823
whitesmoke #f5f5f5 zh-cn_image_0000001127284992
yellow #ffff00 zh-cn_image_0000001173324837
yellowgreen #9acd32 zh-cn_image_0000001173164923

你可能感兴趣的鸿蒙文章

harmony 鸿蒙兼容JS的类Web开发范式(ArkUI.Full)

harmony 鸿蒙button

harmony 鸿蒙chart

harmony 鸿蒙divider

harmony 鸿蒙image-animator

harmony 鸿蒙image

harmony 鸿蒙input

harmony 鸿蒙label

harmony 鸿蒙marquee

harmony 鸿蒙menu

0  赞