harmony 鸿蒙Data Type Attributes

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

Data Type Attributes

Length Type

Name Type Description
length string | number Size unit. When the type is number, the unit is px. When the type is string, the pixel unit needs to be explicitly specified. Currently, the following pixel units are supported:
- px: logical size unit.
- fp6+: font size unit, which varies with the system font size. This unit is only available for text components.
percentage string Unit in percentage, for example, 50%.

Color Type

Name Type Description
color string |  color enums Color information. The color enums are not supported in JavaScript scripts.
Available string formats are as follows:
- ‘rgb(255, 255, 255)’
- ‘rgba(255, 255, 255, 1.0)’
- HEX format: ‘#rrggbb’, ‘#aarrggbb’
- Enumeration format: ‘black’,‘white’.

Table 1 Color enums

Name Hexadecimal Code Color
aliceblue #f0f8ff en-us_image_0000001173324803
antiquewhite #faebd7 en-us_image_0000001127285014
aqua #00ffff en-us_image_0000001127285050
aquamarine #7fffd4 en-us_image_0000001173324729
azure #f0ffff en-us_image_0000001127285040
beige #f5f5dc en-us_image_0000001173324773
bisque #ffe4c4 en-us_image_0000001173164895
black #000000 en-us_image_0000001173324735
blanchedalmond #ffebcd en-us_image_0000001173164889
blue #0000ff en-us_image_0000001127125194
blueviolet #8a2be2 en-us_image_0000001127285046
brown #a52a2a en-us_image_0000001173324833
burlywood #deB887 en-us_image_0000001127285026
cadetblue #5f9ea0 en-us_image_0000001127125210
chartreuse #7fff00 en-us_image_0000001173324811
chocolate #d2691e en-us_image_0000001127125256
coral #ff7f50 en-us_image_0000001173164877
cornflowerblue #6495ed en-us_image_0000001173324781
cornsilk #fff8dc en-us_image_0000001127285048
crimson #dc143c en-us_image_0000001127285066
cyan #00ffff en-us_image_0000001173324789
darkblue #00008b en-us_image_0000001173164841
darkcyan #008b8b en-us_image_0000001173324745
darkgoldenrod #b8860b en-us_image_0000001173324835
darkgray #a9a9a9 en-us_image_0000001127285028
darkgreen #006400 en-us_image_0000001127284990
darkgrey #a9a9a9 en-us_image_0000001127125174
darkkhaki #bdb76b en-us_image_0000001127285070
darkmagenta #8b008b en-us_image_0000001173164875
darkolivegreen #556b2f en-us_image_0000001173164835
darkorange #ff8c00 en-us_image_0000001127125178
darkorchid #9932cc en-us_image_0000001173324829
darkred #8b0000 en-us_image_0000001173164851
darksalmon #e9967a en-us_image_0000001127284998
darkseagreen #8fbc8f en-us_image_0000001173324755
darkslateblue #483d8b en-us_image_0000001127125246
darkslategray #2f4f4f en-us_image_0000001127125190
darkslategrey #2f4f4f en-us_image_0000001173324759
darkturquoise #00ced1 en-us_image_0000001127284980
darkviolet #9400d3 en-us_image_0000001127285058
deeppink #ff1493 en-us_image_0000001173324767
deepskyblue #00bfff en-us_image_0000001173164897
dimgray #696969 en-us_image_0000001127285022
dimgrey #696969 en-us_image_0000001173164911
dodgerblue #1e90ff en-us_image_0000001173164855
firebrick #b22222 en-us_image_0000001127125234
floralwhite #fffaf0 en-us_image_0000001173324771
forestgreen #228b22 en-us_image_0000001173324825
fuchsia #ff00ff en-us_image_0000001127285052
gainsboro #dcdcdc en-us_image_0000001173164901
ghostwhite #f8f8ff en-us_image_0000001127285012
gold #ffd700 en-us_image_0000001173324761
goldenrod #daa520 en-us_image_0000001173324817
gray #808080 en-us_image_0000001127125238
green #008000 en-us_image_0000001173164865
greenyellow #adff2f en-us_image_0000001127285000
grey #808080 en-us_image_0000001127285054
honeydew #f0fff0 en-us_image_0000001173324813
hotpink #ff69b4 en-us_image_0000001127285016
indianred #cd5c5c en-us_image_0000001173164849
indigo #4b0082 en-us_image_0000001173324821
ivory #fffff0 en-us_image_0000001173164887
khaki #f0e68c en-us_image_0000001173324801
lavender #e6e6fa en-us_image_0000001127125188
lavenderblush #fff0f5 en-us_image_0000001173324809
lawngreen #7cfc00 en-us_image_0000001127125224
lemonchiffon #fffacd en-us_image_0000001173164879
lightblue #add8e6 en-us_image_0000001127125180
lightcoral #f08080 en-us_image_0000001127125228
lightcyan #e0ffff en-us_image_0000001173324799
lightgoldenrodyellow #fafad2 en-us_image_0000001127125218
lightgray #d3d3d3 en-us_image_0000001127284974
lightgreen #90ee90 en-us_image_0000001173324805
lightpink #ffb6c1 en-us_image_0000001127285038
lightsalmon #ffa07a en-us_image_0000001173324795
lightseagreen #20b2aa en-us_image_0000001173324737
lightskyblue #87cefa en-us_image_0000001127285042
lightslategray #778899 en-us_image_0000001127125226
lightslategrey #778899 en-us_image_0000001127125222
lightsteelblue #b0c4de en-us_image_0000001127284976
lightyellow #ffffe0 en-us_image_0000001173324807
lime #00ff00 en-us_image_0000001127285020
limegreen #32cd32 en-us_image_0000001127125236
linen #faf0e6 en-us_image_0000001173324739
magenta #ff00ff en-us_image_0000001127285044
maroon #800000 en-us_image_0000001127285018
mediumaquamarine #66cdaa en-us_image_0000001173164899
mediumblue #0000cd en-us_image_0000001127284968
mediumorchid #ba55d3 en-us_image_0000001127125216
mediumpurple #9370db en-us_image_0000001173324779
mediumseagreen #3cb371 en-us_image_0000001127125230
mediumslateblue #7b68ee en-us_image_0000001173164921
mediumspringgreen #00fa9a en-us_image_0000001173324793
mediumturquoise #48d1cc en-us_image_0000001127125214
mediumvioletred #c71585 en-us_image_0000001173164893
midnightblue #191970 en-us_image_0000001127125260
mintcream #f5fffa en-us_image_0000001127285030
mistyrose #ffe4e1 en-us_image_0000001173324785
moccasin #ffe4b5 en-us_image_0000001127125232
navajowhite #ffdead en-us_image_0000001173164925
navy #000080 en-us_image_0000001127285032
oldlace #fdf5e6 en-us_image_0000001127125184
olive #808000 en-us_image_0000001127125244
olivedrab #6b8e23 en-us_image_0000001173324839
orange #ffa500 en-us_image_0000001173164885
orangered #ff4500 en-us_image_0000001127284996
orchid #da70d6 en-us_image_0000001127285056
palegoldenrod #eee8aa en-us_image_0000001127125262
palegreen #98fb98 en-us_image_0000001127285006
paleturquoise #afeeee en-us_image_0000001173324757
palevioletred #db7093 en-us_image_0000001173164905
papayawhip #ffefd5 en-us_image_0000001127125248
peachpuff #ffdab9 en-us_image_0000001173324769
peru #cd853f en-us_image_0000001173164843
pink #ffc0cb en-us_image_0000001127125242
plum #dda0dd en-us_image_0000001173324831
powderblue #b0e0e6 en-us_image_0000001127285010
purple #800080 en-us_image_0000001127285002
rebeccapurple #663399 en-us_image_0000001173164907
red #ff0000 en-us_image_0000001127125254
rosybrown #bc8f8f en-us_image_0000001173324775
royalblue #4169e1 en-us_image_0000001127284972
saddlebrown #8b4513 en-us_image_0000001127125250
salmon #fa8072 en-us_image_0000001127285064
sandybrown #f4a460 en-us_image_0000001173324777
seagreen #2e8b57 en-us_image_0000001173324733
seashell #fff5ee en-us_image_0000001127285062
sienna #a0522d en-us_image_0000001173164917
silver #c0c0c0 en-us_image_0000001173324743
skyblue #87ceeb en-us_image_0000001127284970
slateblue #6a5acd en-us_image_0000001173164915
slategray #708090 en-us_image_0000001173324815
slategrey #708090 en-us_image_0000001127284982
snow #fffafa en-us_image_0000001173324731
springgreen #00ff7f en-us_image_0000001127285060
steelblue #4682b4 en-us_image_0000001127125240
tan #d2b48c en-us_image_0000001173324747
teal #008080 en-us_image_0000001173324741
thistle #d8Bfd8 en-us_image_0000001173164913
tomato #ff6347 en-us_image_0000001173164909
turquoise #40e0d0 en-us_image_0000001173164837
violet #ee82ee en-us_image_0000001127125258
wheat #f5deb3 en-us_image_0000001127285068
white #ffffff en-us_image_0000001173324823
whitesmoke #f5f5f5 en-us_image_0000001127284992
yellow #ffff00 en-us_image_0000001173324837
yellowgreen #9acd32 en-us_image_0000001173164923

你可能感兴趣的鸿蒙文章

harmony 鸿蒙JavaScript-compatible Web-like Development Paradigm

harmony 鸿蒙button

harmony 鸿蒙chart

harmony 鸿蒙divider

harmony 鸿蒙image-animator

harmony 鸿蒙image

harmony 鸿蒙input

harmony 鸿蒙label

harmony 鸿蒙marquee

harmony 鸿蒙menu

0  赞