1e41f4b71Sopenharmony_ci# Updates (OpenHarmony 3.1 Beta -> OpenHarmony 3.1 Release) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci### Added Validity Verification for Color Values in Color.json 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciValidity verification is added for color values in the **color.json** file. The verification rules are as follows: 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci- The hexadecimal color code is used in any of the following formats: 8e41f4b71Sopenharmony_ci - #rgb: red(0-f) green(0-f) blue(0-f) 9e41f4b71Sopenharmony_ci - #argb: transparency(0-f) red(0-f) green(0-f) blue(0-f) 10e41f4b71Sopenharmony_ci - #rrggbb: red(00-ff) green(00-ff) blue(00-ff) 11e41f4b71Sopenharmony_ci - #aarrggbb: transparency(00-ff) red(00-ff) green(00-ff) blue(00-ff) 12e41f4b71Sopenharmony_ci- The dollar sign ($) is used to reference resources defined in the application. The format is as follows: 13e41f4b71Sopenharmony_ci - $color:xxx 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci**Change Impacts** 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciIf the verification rules are not met, an error is reported during compilation. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**Key API/Component Changes** 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ciNone 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci### Restrictions on Declaring Multiple Data Types of State Variables 24e41f4b71Sopenharmony_ci 25e41f4b71Sopenharmony_ciIf a **@State**, **@Provide**, **@Link**, or **@Consume** decorated state variable supports multiple data types, they must be all simple data types or references at one time. 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ciExample: 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci```ts 30e41f4b71Sopenharmony_ci@Entry 31e41f4b71Sopenharmony_ci@Component 32e41f4b71Sopenharmony_cistruct Index { 33e41f4b71Sopenharmony_ci // Incorrect: @State message: string | Resource = 'Hello World' 34e41f4b71Sopenharmony_ci @State message: string = 'Hello World' 35e41f4b71Sopenharmony_ci 36e41f4b71Sopenharmony_ci build() { 37e41f4b71Sopenharmony_ci Row() { 38e41f4b71Sopenharmony_ci Column() { 39e41f4b71Sopenharmony_ci Text(`${ this.message }`) 40e41f4b71Sopenharmony_ci .fontSize(50) 41e41f4b71Sopenharmony_ci .fontWeight(FontWeight.Bold) 42e41f4b71Sopenharmony_ci } 43e41f4b71Sopenharmony_ci .width('100%') 44e41f4b71Sopenharmony_ci } 45e41f4b71Sopenharmony_ci .height('100%') 46e41f4b71Sopenharmony_ci } 47e41f4b71Sopenharmony_ci} 48e41f4b71Sopenharmony_ci``` 49e41f4b71Sopenharmony_ci 50e41f4b71Sopenharmony_ci**Change Impacts** 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ciWhen the defined state variable type contains both the simple data types and references, an error is reported during compilation. 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci**Key API/Component Changes** 55e41f4b71Sopenharmony_ci 56e41f4b71Sopenharmony_ciIf the defined state variable type contains both the simple data types and references, change the type to one of them, as shown in the preceding sample code. 57