1 2/* 3 * Copyright (c) 2024 Huawei Device Co., Ltd. 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/** 18 * @file 19 * @kit ArkUI 20 */ 21/** 22 * Defines the struct of Theme. 23 * 24 * @interface Theme 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @crossplatform 27 * @atomicservice 28 * @since 12 29 */ 30export declare interface Theme { 31 /** 32 * Define tokens associated with color resources. 33 * 34 * @type { Colors } 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @crossplatform 37 * @atomicservice 38 * @since 12 39 */ 40 colors: Colors; 41} 42 43/** 44 * Defines the struct of Colors. 45 * 46 * @interface Colors 47 * @syscap SystemCapability.ArkUI.ArkUI.Full 48 * @crossplatform 49 * @atomicservice 50 * @since 12 51 */ 52export declare interface Colors { 53 54 /** 55 * System brand Color. 56 * 57 * @type { ResourceColor } 58 * @syscap SystemCapability.ArkUI.ArkUI.Full 59 * @crossplatform 60 * @atomicservice 61 * @since 12 62 */ 63 brand: ResourceColor; 64 65 /** 66 * System warning Color. 67 * 68 * @type { ResourceColor } 69 * @syscap SystemCapability.ArkUI.ArkUI.Full 70 * @crossplatform 71 * @atomicservice 72 * @since 12 73 */ 74 warning: ResourceColor; 75 76 /** 77 * System alert Color. 78 * 79 * @type { ResourceColor } 80 * @syscap SystemCapability.ArkUI.ArkUI.Full 81 * @crossplatform 82 * @atomicservice 83 * @since 12 84 */ 85 alert: ResourceColor; 86 87 /** 88 * System confirm Color. 89 * 90 * @type { ResourceColor } 91 * @syscap SystemCapability.ArkUI.ArkUI.Full 92 * @crossplatform 93 * @atomicservice 94 * @since 12 95 */ 96 confirm: ResourceColor; 97 98 /** 99 * First level text color. 100 * 101 * @type { ResourceColor } 102 * @syscap SystemCapability.ArkUI.ArkUI.Full 103 * @crossplatform 104 * @atomicservice 105 * @since 12 106 */ 107 fontPrimary: ResourceColor; 108 109 /** 110 * Secondary text color. 111 * 112 * @type { ResourceColor } 113 * @syscap SystemCapability.ArkUI.ArkUI.Full 114 * @crossplatform 115 * @atomicservice 116 * @since 12 117 */ 118 fontSecondary: ResourceColor; 119 120 /** 121 * tertiary text color. 122 * 123 * @type { ResourceColor } 124 * @syscap SystemCapability.ArkUI.ArkUI.Full 125 * @crossplatform 126 * @atomicservice 127 * @since 12 128 */ 129 fontTertiary: ResourceColor; 130 131 /** 132 * Fourth text color. 133 * 134 * @type { ResourceColor } 135 * @syscap SystemCapability.ArkUI.ArkUI.Full 136 * @crossplatform 137 * @atomicservice 138 * @since 12 139 */ 140 fontFourth: ResourceColor; 141 142 /** 143 * Emphasize text color. 144 * 145 * @type { ResourceColor } 146 * @syscap SystemCapability.ArkUI.ArkUI.Full 147 * @crossplatform 148 * @atomicservice 149 * @since 12 150 */ 151 fontEmphasize: ResourceColor; 152 153 /** 154 * First level text inversion, used on colored backgrounds. 155 * 156 * @type { ResourceColor } 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @crossplatform 159 * @atomicservice 160 * @since 12 161 */ 162 fontOnPrimary: ResourceColor; 163 164 /** 165 * Secondary level text inversion, used on colored backgrounds. 166 * 167 * @type { ResourceColor } 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @atomicservice 171 * @since 12 172 */ 173 fontOnSecondary: ResourceColor; 174 175 /** 176 * Tertiary level text inversion, used on colored backgrounds. 177 * 178 * @type { ResourceColor } 179 * @syscap SystemCapability.ArkUI.ArkUI.Full 180 * @crossplatform 181 * @atomicservice 182 * @since 12 183 */ 184 fontOnTertiary: ResourceColor; 185 186 /** 187 * Fourth level text inversion, used on colored backgrounds. 188 * 189 * @type { ResourceColor } 190 * @syscap SystemCapability.ArkUI.ArkUI.Full 191 * @crossplatform 192 * @atomicservice 193 * @since 12 194 */ 195 fontOnFourth: ResourceColor; 196 197 /** 198 * First level icon color. 199 * 200 * @type { ResourceColor } 201 * @syscap SystemCapability.ArkUI.ArkUI.Full 202 * @crossplatform 203 * @atomicservice 204 * @since 12 205 */ 206 iconPrimary: ResourceColor; 207 208 /** 209 * Secondary level icon color. 210 * 211 * @type { ResourceColor } 212 * @syscap SystemCapability.ArkUI.ArkUI.Full 213 * @crossplatform 214 * @atomicservice 215 * @since 12 216 */ 217 iconSecondary: ResourceColor; 218 219 /** 220 * Tertiary level icon color. 221 * 222 * @type { ResourceColor } 223 * @syscap SystemCapability.ArkUI.ArkUI.Full 224 * @crossplatform 225 * @atomicservice 226 * @since 12 227 */ 228 iconTertiary: ResourceColor; 229 230 /** 231 * Fourth level icon color. 232 * 233 * @type { ResourceColor } 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @crossplatform 236 * @atomicservice 237 * @since 12 238 */ 239 iconFourth: ResourceColor; 240 241 /** 242 * Emphasize level icon color. 243 * 244 * @type { ResourceColor } 245 * @syscap SystemCapability.ArkUI.ArkUI.Full 246 * @crossplatform 247 * @atomicservice 248 * @since 12 249 */ 250 iconEmphasize: ResourceColor; 251 252 /** 253 * Secondary emphasize level icon color. 254 * 255 * @type { ResourceColor } 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @crossplatform 258 * @atomicservice 259 * @since 12 260 */ 261 iconSubEmphasize: ResourceColor; 262 263 /** 264 * First level icon reversed, used on a colored background. 265 * 266 * @type { ResourceColor } 267 * @syscap SystemCapability.ArkUI.ArkUI.Full 268 * @crossplatform 269 * @atomicservice 270 * @since 12 271 */ 272 iconOnPrimary: ResourceColor; 273 274 /** 275 * Secondary level icon reversed, used on a colored background. 276 * 277 * @type { ResourceColor } 278 * @syscap SystemCapability.ArkUI.ArkUI.Full 279 * @crossplatform 280 * @atomicservice 281 * @since 12 282 */ 283 iconOnSecondary: ResourceColor; 284 285 /** 286 * Tertiary level icon reversed, used on a colored background. 287 * 288 * @type { ResourceColor } 289 * @syscap SystemCapability.ArkUI.ArkUI.Full 290 * @crossplatform 291 * @atomicservice 292 * @since 12 293 */ 294 iconOnTertiary: ResourceColor; 295 296 /** 297 * Fourth level icon reversed, used on a colored background. 298 * 299 * @type { ResourceColor } 300 * @syscap SystemCapability.ArkUI.ArkUI.Full 301 * @crossplatform 302 * @atomicservice 303 * @since 12 304 */ 305 iconOnFourth: ResourceColor; 306 307 /** 308 * System Primary level background color. 309 * 310 * @type { ResourceColor } 311 * @syscap SystemCapability.ArkUI.ArkUI.Full 312 * @crossplatform 313 * @atomicservice 314 * @since 12 315 */ 316 backgroundPrimary: ResourceColor; 317 318 /** 319 * System Secondary level background color. 320 * 321 * @type { ResourceColor } 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @crossplatform 324 * @atomicservice 325 * @since 12 326 */ 327 backgroundSecondary: ResourceColor; 328 329 /** 330 * System tertiary level background color. 331 * 332 * @type { ResourceColor } 333 * @syscap SystemCapability.ArkUI.ArkUI.Full 334 * @crossplatform 335 * @atomicservice 336 * @since 12 337 */ 338 backgroundTertiary: ResourceColor; 339 340 /** 341 * System fourth level background color. 342 * 343 * @type { ResourceColor } 344 * @syscap SystemCapability.ArkUI.ArkUI.Full 345 * @crossplatform 346 * @atomicservice 347 * @since 12 348 */ 349 backgroundFourth: ResourceColor; 350 351 /** 352 * System emphasize level background color. 353 * 354 * @type { ResourceColor } 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @atomicservice 358 * @since 12 359 */ 360 backgroundEmphasize: ResourceColor; 361 362 /** 363 * CompForegroundPrimary color. 364 * 365 * @type { ResourceColor } 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @crossplatform 368 * @atomicservice 369 * @since 12 370 */ 371 compForegroundPrimary: ResourceColor; 372 373 /** 374 * CompBackgroundPrimary color. 375 * 376 * @type { ResourceColor } 377 * @syscap SystemCapability.ArkUI.ArkUI.Full 378 * @crossplatform 379 * @atomicservice 380 * @since 12 381 */ 382 compBackgroundPrimary: ResourceColor; 383 384 /** 385 * CompBackgroundPrimaryTran color. 386 * 387 * @type { ResourceColor } 388 * @syscap SystemCapability.ArkUI.ArkUI.Full 389 * @crossplatform 390 * @atomicservice 391 * @since 12 392 */ 393 compBackgroundPrimaryTran: ResourceColor; 394 395 /** 396 * CompBackgroundPrimaryContrary color. 397 * 398 * @type { ResourceColor } 399 * @syscap SystemCapability.ArkUI.ArkUI.Full 400 * @crossplatform 401 * @atomicservice 402 * @since 12 403 */ 404 compBackgroundPrimaryContrary: ResourceColor; 405 406 /** 407 * CompBackgroundGray color. 408 * 409 * @type { ResourceColor } 410 * @syscap SystemCapability.ArkUI.ArkUI.Full 411 * @crossplatform 412 * @atomicservice 413 * @since 12 414 */ 415 compBackgroundGray: ResourceColor; 416 417 /** 418 * 10% black universal control background. 419 * 420 * @type { ResourceColor } 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @crossplatform 423 * @atomicservice 424 * @since 12 425 */ 426 compBackgroundSecondary: ResourceColor; 427 428 /** 429 * 5% black universal control background. 430 * 431 * @type { ResourceColor } 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @crossplatform 434 * @atomicservice 435 * @since 12 436 */ 437 compBackgroundTertiary: ResourceColor; 438 439 /** 440 * 100% bright brand background color. 441 * 442 * @type { ResourceColor } 443 * @syscap SystemCapability.ArkUI.ArkUI.Full 444 * @crossplatform 445 * @atomicservice 446 * @since 12 447 */ 448 compBackgroundEmphasize: ResourceColor; 449 450 /** 451 * Black neutral high gloss color. 452 * 453 * @type { ResourceColor } 454 * @syscap SystemCapability.ArkUI.ArkUI.Full 455 * @crossplatform 456 * @atomicservice 457 * @since 12 458 */ 459 compBackgroundNeutral: ResourceColor; 460 461 /** 462 * 20% High gloss brand background color. 463 * 464 * @type { ResourceColor } 465 * @syscap SystemCapability.ArkUI.ArkUI.Full 466 * @crossplatform 467 * @atomicservice 468 * @since 12 469 */ 470 compEmphasizeSecondary: ResourceColor; 471 472 /** 473 * 10% High gloss brand background color. 474 * 475 * @type { ResourceColor } 476 * @syscap SystemCapability.ArkUI.ArkUI.Full 477 * @crossplatform 478 * @atomicservice 479 * @since 12 480 */ 481 compEmphasizeTertiary: ResourceColor; 482 483 /** 484 * Universal Division Line Color 485 * 486 * @type { ResourceColor } 487 * @syscap SystemCapability.ArkUI.ArkUI.Full 488 * @crossplatform 489 * @atomicservice 490 * @since 12 491 */ 492 compDivider: ResourceColor; 493 494 /** 495 * CompCommonContrary Color 496 * 497 * @type { ResourceColor } 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @crossplatform 500 * @atomicservice 501 * @since 12 502 */ 503 compCommonContrary: ResourceColor; 504 505 /** 506 * CompBackgroundFocus Color 507 * 508 * @type { ResourceColor } 509 * @syscap SystemCapability.ArkUI.ArkUI.Full 510 * @crossplatform 511 * @atomicservice 512 * @since 12 513 */ 514 compBackgroundFocus: ResourceColor; 515 516 /** 517 * CompFocusedPrimary Color 518 * 519 * @type { ResourceColor } 520 * @syscap SystemCapability.ArkUI.ArkUI.Full 521 * @crossplatform 522 * @atomicservice 523 * @since 12 524 */ 525 compFocusedPrimary: ResourceColor; 526 527 /** 528 * CompFocusedSecondary Color 529 * 530 * @type { ResourceColor } 531 * @syscap SystemCapability.ArkUI.ArkUI.Full 532 * @crossplatform 533 * @atomicservice 534 * @since 12 535 */ 536 compFocusedSecondary: ResourceColor; 537 538 /** 539 * CompFocusedTertiary Color 540 * 541 * @type { ResourceColor } 542 * @syscap SystemCapability.ArkUI.ArkUI.Full 543 * @crossplatform 544 * @atomicservice 545 * @since 12 546 */ 547 compFocusedTertiary: ResourceColor; 548 549 /** 550 * Hover interactive color 551 * 552 * @type { ResourceColor } 553 * @syscap SystemCapability.ArkUI.ArkUI.Full 554 * @crossplatform 555 * @atomicservice 556 * @since 12 557 */ 558 interactiveHover: ResourceColor; 559 560 /** 561 * Pressed interactive color 562 * 563 * @type { ResourceColor } 564 * @syscap SystemCapability.ArkUI.ArkUI.Full 565 * @crossplatform 566 * @atomicservice 567 * @since 12 568 */ 569 interactivePressed: ResourceColor; 570 571 /** 572 * Focus interactive color 573 * 574 * @type { ResourceColor } 575 * @syscap SystemCapability.ArkUI.ArkUI.Full 576 * @crossplatform 577 * @atomicservice 578 * @since 12 579 */ 580 interactiveFocus: ResourceColor; 581 582 /** 583 * Active interactive color 584 * 585 * @type { ResourceColor } 586 * @syscap SystemCapability.ArkUI.ArkUI.Full 587 * @crossplatform 588 * @atomicservice 589 * @since 12 590 */ 591 interactiveActive: ResourceColor; 592 593 /** 594 * Select interactive color 595 * 596 * @type { ResourceColor } 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @crossplatform 599 * @atomicservice 600 * @since 12 601 */ 602 interactiveSelect: ResourceColor; 603 604 /** 605 * Click interactive color 606 * 607 * @type { ResourceColor } 608 * @syscap SystemCapability.ArkUI.ArkUI.Full 609 * @crossplatform 610 * @atomicservice 611 * @since 12 612 */ 613 interactiveClick: ResourceColor; 614} 615 616/** 617 * Defines the struct of CustomTheme. 618 * 619 * @interface CustomTheme 620 * @syscap SystemCapability.ArkUI.ArkUI.Full 621 * @crossplatform 622 * @atomicservice 623 * @since 12 624 */ 625export declare interface CustomTheme { 626 /** 627 * Define tokens associated with color resources.. 628 * 629 * @type { ?CustomColors } 630 * @syscap SystemCapability.ArkUI.ArkUI.Full 631 * @crossplatform 632 * @atomicservice 633 * @since 12 634 */ 635 colors?: CustomColors; 636} 637 638/** 639 * Defines the struct of CustomColors. 640 * 641 * @typedef { Partial<Colors> } CustomColors 642 * @syscap SystemCapability.ArkUI.ArkUI.Full 643 * @crossplatform 644 * @atomicservice 645 * @since 12 646 */ 647export declare type CustomColors = Partial<Colors>; 648 649/** 650 * Class ThemeControl provides the Theme management for whole Ability and pages. 651 * 652 * @syscap SystemCapability.ArkUI.ArkUI.Full 653 * @crossplatform 654 * @atomicservice 655 * @since 12 656 */ 657export declare class ThemeControl { 658 /** 659 * Sets the default Theme: 660 * - for whole Ability when invoked from the Ability level code. 661 * - for the ArkUI page and for later opened pages when invoked at the ArkUI page level. 662 * 663 * @param { CustomTheme } theme 664 * @syscap SystemCapability.ArkUI.ArkUI.Full 665 * @crossplatform 666 * @atomicservice 667 * @since 12 668 */ 669 static setDefaultTheme(theme: CustomTheme): void; 670} 671