Visual theme switching methods, devices, equipment, storage media, and products
By extracting multimodal parameters to generate style semantic vectors and using artificial intelligence models to dynamically generate visual theme resource packages, the problem of theme fixation in existing technologies is solved, and personalized visual experience and dynamic adjustment are realized.
Patent Information
- Application Number
- CN202611153288.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-17
AI Technical Summary
The existing visual theme switching method requires designers to create multiple complete theme resource packages in advance, which makes it impossible to dynamically adjust the theme content according to users' real-time preferences or scene changes after the theme is released.
In response to theme generation instructions, style semantic vectors are extracted from multimodal parameters, a preset artificial intelligence model is called to generate a theme resource package, and a visual theme is switched based on the resource package, including the generation of color schemes, vector icon sets and background images.
It enables on-demand intelligent generation and dynamic switching of visual themes, enhancing the personalized visual experience, reducing the cost of theme customization, and ensuring the style consistency and visual harmony of resource packages.
Smart Images

Figure CN123114604A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a visual theme switching method, apparatus, device, storage medium, and product. Background Technology
[0002] Currently, with the increasing demand for personalization and brand customization in mobile applications, visual themes (including a collection of resources such as color schemes, icon styles, and background images) have become a core element for differentiating application brand image, adapting to user preferences, and responding to changes in scenarios.
[0003] However, the visual theme switching method requires designers to pre-create multiple complete theme resource packages (including colors.xml color scheme definitions, Vector Drawable icon sets, and background image resources), which are then packaged and released with the application or distributed over the network. When a user switches themes, the system selects the target theme from the pre-built resource packages and rebuilds the interface through Activity or setTheme. This results in the theme content being completely fixed after release and unable to be dynamically adjusted according to real-time user preferences or scene changes. Summary of the Invention
[0004] The main purpose of this application is to provide a visual theme switching method, device, equipment, storage medium and product, which aims to solve the technical problem that related visual theme switching methods require designers to create multiple complete theme resource packages in advance, resulting in the theme content being completely fixed after release and unable to be dynamically adjusted according to user preferences or scene changes in real time.
[0005] To achieve the above objectives, this application provides a visual theme switching method, the visual theme switching method comprising: In response to a topic generation instruction, multimodal parameters are extracted from the topic generation instruction, and the multimodal parameters are fused and encoded into a style semantic vector; The style semantic vector is input into a preset artificial intelligence model to generate a theme resource package; The visual theme on the device is switched based on the aforementioned theme resource package.
[0006] Optionally, the preset artificial intelligence model includes a preset color scheme model, a preset icon model, and a preset background model; the step of inputting the style semantic vector into the preset artificial intelligence model to generate a theme resource package includes: The style semantic vector is input into the preset color model to generate a color scheme that matches the target style. The style semantic vector is input into the preset icon model to generate a vector icon set with a unified style; The style semantic vector is input into the preset background model to generate a background image that matches the theme. A theme resource package is generated based on the color scheme, the vector icon set, and the background image.
[0007] Optionally, the step of inputting the style semantic vector into the preset color model to generate a color scheme that conforms to the target style includes: The brand color parameters in the multimodal parameters are concatenated with the style semantic vector and then input into the preset color model to generate an initial color scheme containing multiple semantic color tokens. Perform contrast verification on the color combinations in the initial color scheme, where the color combinations are a combination of foreground and background colors; Based on the contrast verification results, color combinations that do not meet the preset compliance standards are corrected to obtain a color scheme that conforms to the target style.
[0008] Optionally, the step of inputting the style semantic vector into the preset icon model to generate a vector icon set with a unified style includes: Obtain the original vector icon to be stylized, and extract the geometric skeleton information of the original vector icon. The geometric skeleton information includes the coordinates of the path control points and the topological connection relationship between the path segments. The geometric skeleton information and the style semantic vector are fused into a joint condition input to the preset icon model. The preset icon model generates vector path data that adapts to the target style while preserving the icon topology and semantic recognizability. Perform a validity check on the generated vector path data, and generate a vector icon set with a unified style based on the validity check results.
[0009] Optionally, the step of inputting the style semantic vector into the preset background model to generate a background image adapted to the theme includes: The scene description text in the multimodal parameters is encoded into a text semantic embedding vector; The text semantic embedding vector and the style semantic vector are concatenated and then input into the preset background model to generate a background image that matches the theme.
[0010] Optionally, switching the visual theme on the device side based on the theme resource package includes: Based on the aforementioned theme resource package, the visual theme on the client side is switched using the View system rendering mode; Alternatively, the visual theme on the client side can be switched using the Compose rendering mode based on the theme resource package.
[0011] Optionally, switching the visual theme on the client side based on the theme resource package through the View system rendering mode includes: Construct a target resource implementation instance that includes color, icon, and background resource mapping relationships based on the theme resource package; Based on the target resource implementation instance, the original resource implementation instance in the current context is replaced by the reflection mechanism, so that the resource system loads the target theme resource; When the resource system loads the target theme resource, it traverses the view tree of the current interface, triggering view re-layout and redrawing to switch the visual theme on the client side.
[0012] Optionally, switching the visual theme on the client side based on the theme resource package using the Compose rendering mode includes: The color schemes in the theme resource package are converted into semantic theme parameters that can be adapted to the composable framework and encapsulated as theme status data; The topic state data is updated by a reactive state stream, triggering the composable components referencing the topic to perform reorganization. During the component reorganization cycle, the entire interface theme resources are synchronized and updated to switch the visual theme on the client side.
[0013] Optionally, before switching the visual theme on the device side based on the theme resource package, the method further includes: Perform style consistency checks on all types of resources within the theme resource package and identify resource branches that deviate from the target style; Resource branches that deviate from the target style are regenerated to obtain a target theme resource package that meets style consistency constraints. Accordingly, the switching of the visual theme on the device side based on the theme resource package includes: switching the visual theme on the device side based on the target theme resource package.
[0014] Optionally, the step of performing style consistency verification on various resources within the theme resource package and identifying resource branches that deviate from the target style includes: The style features of each type of resource in the theme resource package are extracted separately, and the style features are encoded into resource style vectors of corresponding dimensions; Calculate the similarity between each resource style vector and the style semantic vector, and identify resource branches with similarity below a preset threshold as resource branches that deviate from the target style.
[0015] Optionally, the step of extracting multimodal parameters from the topic generation instruction in response to the topic generation instruction, and fusing and encoding the multimodal parameters into a style semantic vector, includes: In response to the theme generation command, the theme generation command is parsed to obtain brand color parameters, scene description text and style tag parameters; Feature encoding is performed on the brand color parameters, scene description text, and style tag parameters respectively to obtain color feature vectors, scene feature vectors, and style feature vectors; The color feature vector, the scene feature vector, and the style feature vector are concatenated and fused to generate a style semantic vector with a unified dimension.
[0016] Furthermore, to achieve the above objectives, this application also proposes a visual theme switching device, which includes: A vector generation module is used to extract multimodal parameters from a topic generation instruction in response to the topic generation instruction, and fuse and encode the multimodal parameters into a style semantic vector; The resource package generation module is used to call a preset artificial intelligence model, input the style semantic vector into the preset artificial intelligence model, and generate a theme resource package; The theme switching module is used to switch the visual theme on the terminal side based on the theme resource package.
[0017] Optionally, the preset artificial intelligence model includes a preset color scheme model, a preset icon model, and a preset background model; the resource package generation module is further configured to input the style semantic vector into the preset color scheme model to generate a color scheme that conforms to the target style; input the style semantic vector into the preset icon model to generate a vector icon set with a unified style; input the style semantic vector into the preset background model to generate a background image that matches the theme; and generate a theme resource package based on the color scheme, the vector icon set, and the background image.
[0018] Optionally, the resource package generation module is further configured to concatenate the brand color parameters in the multimodal parameters with the style semantic vector and input them into the preset color matching model to generate an initial color scheme containing multiple semantic color tokens; perform contrast verification on the color combinations in the initial color scheme, wherein the color combination is a combination of foreground and background colors; and correct color combinations that do not meet the preset compliance standards based on the contrast verification results to obtain a color scheme that conforms to the target style.
[0019] Optionally, the resource package generation module is further configured to obtain the original vector icon to be stylized, and extract the geometric skeleton information of the original vector icon, the geometric skeleton information including the coordinates of path control points and the topological connection relationship between path segments; fuse the geometric skeleton information with the style semantic vector as a joint condition input to the preset icon model, the preset icon model generating vector path data adapted to the target style under the constraint of preserving the icon topological structure and semantic recognizability; perform legality verification on the generated vector path data, and generate a vector icon set with a unified style based on the legality verification result.
[0020] Optionally, the resource package generation module is further configured to encode the scene description text in the multimodal parameters into a text semantic embedding vector; and to concatenate the text semantic embedding vector with the style semantic vector and input it into the preset background model to generate a background image that matches the theme.
[0021] Optionally, the theme switching module is further configured to switch the terminal-side visual theme based on the theme resource package using the View system rendering mode; or, to switch the terminal-side visual theme based on the theme resource package using the Compose system rendering mode.
[0022] In addition, to achieve the above objectives, this application also proposes a visual theme switching device, which includes a memory, a processor, and a visual theme switching program stored in the memory and executable on the processor. The visual theme switching program is configured to implement the visual theme switching method described above.
[0023] In addition, to achieve the above objectives, this application also proposes a storage medium storing a visual theme switching program, which, when executed by a processor, implements the visual theme switching method as described above.
[0024] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a visual theme switching program, and when the visual theme switching program is executed by a processor, it implements the visual theme switching method as described above.
[0025] One or more technical solutions proposed in this application have at least the following technical effects: This application discloses a method for responding to a theme generation command, extracting multimodal parameters from the command, fusing and encoding these parameters into a style semantic vector, calling a preset artificial intelligence model, inputting the style semantic vector into the model, generating a theme resource package, and switching the visual theme on the device based on the resource package. This application, through multimodal parameter encoding, artificial intelligence model generation, and runtime resource switching, enables the real-time generation of a style-consistent theme resource package on the device, thereby achieving on-demand intelligent generation and dynamic switching of visual themes and enhancing the personalized visual experience. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0027] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a flowchart illustrating the first embodiment of the visual theme switching method of this application; Figure 2 This is a flowchart illustrating the second embodiment of the visual theme switching method of this application; Figure 3 This is a flowchart illustrating the third embodiment of the visual theme switching method of this application; Figure 4 This is an overall flowchart of an embodiment of the visual theme switching method of this application; Figure 5 This is a schematic diagram of the module structure of the visual theme switching device according to an embodiment of this application; Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the visual theme switching method in the embodiments of this application.
[0029] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0030] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0031] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0032] This application provides a method for switching visual themes, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the visual theme switching method of this application.
[0033] In the first embodiment, the visual theme switching method includes: Step S10: In response to the topic generation instruction, extract multimodal parameters from the topic generation instruction and fuse and encode the multimodal parameters into a style semantic vector.
[0034] It should be noted that the execution subject of this embodiment can be a visual theme switching device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, or other electronic devices that can achieve the same or similar functions. In this embodiment and other embodiments, the visual theme switching device is described using an Android device as an example.
[0035] It should be understood that the theme generation instruction can refer to the control instruction used to trigger the visual theme generation process on the Android side. It can be triggered by multiple sources, such as manual style selection by the user, input of brand specifications by the brand management system, or automatic detection of environmental changes by scene sensors. The instruction carries various parameter information used to constrain the direction of theme generation. Multimodal parameters can refer to a set of theme constraint parameters derived from different data formats and input modalities. These can include brand primary color values in Hex format, scene semantic description text in natural language format, and target style tags in predefined enumeration format, etc., which jointly define the visual direction of the generated theme from multiple dimensions such as color, semantics, and style. The style semantic vector can refer to a unified-dimensional feature vector obtained after fusing and encoding the multimodal parameters. In this embodiment, the style semantic vector is a 64-dimensional fixed-length vector.
[0036] In its implementation, the system receives externally triggered theme generation instructions, performs structured parsing of these instructions, and extracts input parameters of various modalities, including the brand's primary color, scene semantic description, and target style tags. It then performs color space conversion on the brand's primary color, transforming RGB color values to the LAB color space and normalizing them into numerical features, which serve as the first three basic features of the style semantic vector. The system calls the edge CLIP text encoder to encode the scene semantic description in natural language form, obtaining a high-dimensional semantic embedding vector. This vector is then subjected to dimensionality reduction processing via a lightweight multilayer perceptron network to obtain intermediate-dimensional semantic features. Through a predefined embedding lookup table operation, the enumerated target style tags are converted into corresponding feature vector representations. Finally, the brand color features, semantic description dimensionality reduction features, and style tag features are fused through a concatenation layer and a fully connected layer to output a unified 64-dimensional style semantic vector.
[0037] Step S20: Call the preset artificial intelligence model, input the style semantic vector into the preset artificial intelligence model, and generate a theme resource package.
[0038] It is understandable that the preset artificial intelligence model can refer to multiple lightweight generative artificial intelligence (AI) models pre-deployed on Android devices. These can include at least one of the following: a device-side conditional variational autoencoder (VAE) distillation color model, a vector icon conditional diffusion model, and an SDXL-Turbo distillation background generation model. These models correspond to the generation capabilities of three types of theme resources: color schemes, stylized vector icons, and decorative background images. The theme resource package can refer to the collection of all resources required to carry a complete visual theme. This can include color schemes that conform to the Material Design 3 color token system, stylized vector icon sets, decorative background images adapted to the theme style, and other core resources.
[0039] In the specific implementation, the style semantic vector is used as a shared conditional input, and three AI model inference branches are launched in parallel: color scheme generation, vector icon stylization, and decorative background image generation. The theme resource package is generated based on the color scheme, stylized vector icons, and decorative background images output by the three AI model inference branches.
[0040] Step S30: Switch the visual theme on the terminal side based on the theme resource package.
[0041] It should be understood that the device-side visual theme can refer to the overall visual style collection of an application running on an Android terminal device. It is composed of various visual resources such as color schemes, icon styles, and background images, and uniformly determines the color expression, control styles, and background presentation effects of the application interface.
[0042] In the specific implementation, the system receives the theme resource package, invokes the Choreographer frame synchronization mechanism, and synchronizes all resource replacement operations until the next VSync vertical synchronization signal arrives for unified execution. Based on the rendering system used by the current application, the corresponding switching path is selected. If it's a View system, a target resource implementation instance containing the new resource mapping relationship is constructed, and the original resource implementation instance in the current context is replaced through reflection. Then, the view tree is traversed to trigger a re-layout and redraw. If it's a Compose system, the color parameters are converted into semantic theme parameters adapted to the framework, encapsulated as theme state data, and then the composable component reorganization is triggered through a reactive state stream. All theme resources are atomically replaced within the same frame boundary, avoiding visual flicker caused by mixing old and new theme resources in the same frame, achieving flicker-free hot switching of visual themes on the client side.
[0043] Furthermore, to ensure that the various theme resources generated in parallel by multiple branches all conform to a unified style standard, effectively solve the problem of style fragmentation that easily occurs when multiple AI branches are generated independently, and thus improve the visual coordination and overall look of the intelligently generated themes on the device side, and ensure the presentation quality of personalized themes, before step S30, the method further includes: performing style consistency verification on various resources in the theme resource package, identifying resource branches that deviate from the target style; regenerating the resource branches that deviate from the target style to obtain a target theme resource package that meets the style consistency constraints; correspondingly, step S30 includes: switching the visual theme on the device side based on the target theme resource package.
[0044] It is understandable that a resource branch can refer to a parallel generation chain within the theme resource generation process, independently producing resources of the corresponding type. This can include various types such as color scheme generation branches, vector icon stylization branches, and background image generation branches. Each branch shares a style semantic vector as input but executes inference independently. A style consistency constraint can refer to a rule that requires all types of resources within a theme resource package to adhere to a unified style standard. A target theme resource package can refer to a complete set of theme resources where, after style consistency verification and regeneration correction of any deviations, all resources satisfy the style consistency constraint.
[0045] In the specific implementation, style consistency checks are performed on various resources within the theme resource package to identify resource branches that deviate from the target style. For these deviating branches, the weighting of style semantic vectors in the generation conditions is adjusted to strengthen the guidance of style constraints. The corresponding branch's AI model is re-invoked to perform inference and generate new resources of the corresponding type. Style consistency checks are then performed again on the regenerated resources to determine if they meet the style consistency constraints. If the regenerated resources still do not meet the constraints, the regeneration process is repeated up to three times. When all resource branches meet the style consistency constraints or the maximum number of retries is reached, all resources are integrated to form a target theme resource package that meets the style consistency constraints. The visual theme on the client side is then switched based on the target theme resource package.
[0046] Furthermore, in order to uniformly map different types of theme resources to the same style latent space for quantitative comparison, and to achieve accurate verification of style consistency of multi-branch parallel generated resources, thereby accurately identifying resource branches that deviate from the style, and providing a reliable basis for subsequent resource regeneration correction and overall theme visual quality assurance, the step of verifying the style consistency of various resources in the theme resource package and identifying resource branches that deviate from the target style includes: extracting the style features of various resources in the theme resource package respectively, and encoding the style features into resource style vectors of the corresponding dimension; calculating the similarity between each resource style vector and the style semantic vector, and determining resource branches with similarity lower than a preset threshold as resource branches that deviate from the target style.
[0047] It should be understood that style features can refer to a set of feature indicators extracted from various thematic resources that can quantify their visual style attributes, with different types of resources corresponding to different feature dimensions. A resource style vector can refer to a fixed-dimensional feature vector obtained by mapping and transforming the style features of a single type of resource through a corresponding encoding network. In this embodiment, it is 64-dimensional and is used to quantify the overall style attributes of this type of resource in numerical form.
[0048] In the specific implementation, for the color schemes in the theme resource package, color statistical style features such as hue distribution histogram, average saturation, and brightness contrast are extracted, and these features are mapped into a 64-dimensional color scheme resource style vector through a multilayer perceptron encoding network. For the vector icon set in the theme resource package, line visual style features such as average line width, curve proportion, and fill density are extracted, and these features are mapped into a 64-dimensional icon resource style vector through a multilayer perceptron encoding network. For the background images in the theme resource package, overall image style features such as color temperature, texture complexity, and brightness contrast are extracted, and these features are mapped into a 64-dimensional background resource style vector through a convolutional neural network combined with a pooling structure encoding network.
[0049] Using the style semantic vector generated by multimodal input fusion as the baseline style vector, the cosine similarity between the resource style vectors corresponding to the three resource branches (color scheme, icon, and background) and the baseline style semantic vector is calculated. The calculation method is to divide the dot product of the two vectors by the product of the magnitudes of the two vectors. The cosine similarity result of each resource branch is compared with a preset threshold of 0.85 one by one. Resource branches with a cosine similarity lower than the preset threshold of 0.85 are identified as resource branches that deviate from the target style, thus completing the identification of deviated branches.
[0050] This embodiment uses multimodal parameter encoding, artificial intelligence model generation, and runtime resource switching to generate a unified theme resource package in real time on the device side, thereby enabling on-demand intelligent generation and dynamic switching of visual themes and enhancing the personalized visual experience of visual themes.
[0051] Reference Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the visual theme switching method of this application, based on the above. Figure 1 The first embodiment shown presents a second embodiment of the visual theme switching method of this application.
[0052] In the second embodiment, the preset artificial intelligence model includes a preset color scheme model, a preset icon model, and a preset background model; step S20 includes: Step S201: Input the style semantic vector into the preset color model to generate a color scheme that conforms to the target style.
[0053] It should be understood that the preset color scheme model can refer to a conditional variational autoencoder distillation model deployed on the device side, with parameters compressed to less than 3M. It receives brand color values and style semantic vectors as joint conditional inputs to generate a complete color scheme that conforms to the Material Design 3 color token system. A color scheme can refer to a complete set of Material Design 3 color token values, containing 14 semantic color values, each carrying clear UI semantics and fully defining the color system of the application interface.
[0054] In the specific implementation, the RGB values of the brand's main color are extracted from the multimodal parameters, the three-channel values are normalized to the [0,1] interval, and concatenated with the 64-dimensional style semantic vector to form a 67-dimensional joint conditional input vector; the joint conditional input vector is then passed to the preset color matching model to output a color matching scheme that conforms to the target style.
[0055] Furthermore, in order to quickly generate color schemes that conform to semantic specifications on the device side while ensuring the accessibility and readability of the color schemes, and thus produce compliant and usable theme color schemes without manual verification, thereby improving theme generation efficiency and effectively protecting the visual experience of visually impaired users, step S201 includes: concatenating the brand color parameters in the multimodal parameters with the style semantic vector and inputting them into the preset color scheme model to generate an initial color scheme containing multiple semantic color tokens; performing contrast verification on the color combinations in the initial color scheme, wherein the color combination is a combination of foreground and background colors; and correcting color combinations that do not meet the preset compliance standards based on the contrast verification results to obtain a color scheme that conforms to the target style.
[0056] Understandably, brand color parameters can refer to the RGB values of the brand's primary color extracted from multimodal input, which can originate from the brand logo or brand visual specifications. Semantic color tokens can refer to color naming units in the design system that carry explicit UI semantics. In this embodiment, following the Material Design 3 specification, it includes 14 semantic color values such as primary and surface, each corresponding to a specific interface role and usage scenario. Color combinations can refer to paired colors in a color scheme that have a foreground-background correspondence.
[0057] In the specific implementation, the RGB three-channel values of the brand's main color are extracted from the multimodal parameters, and the values of each channel are normalized to the [0,1] interval to form a 3D color feature. The normalized brand color feature is concatenated with a 64-dimensional style semantic vector to form a joint conditional input vector with a total dimension of 67. The joint conditional input vector is fed into a preset color matching model, and the model encoder maps the conditions to the mean and logarithmic variance of the latent space. The latent variables are sampled through reparameterization techniques, and then the decoder outputs RGB three-channel floating-point results corresponding to 14 semantic colors. The floating-point color values output by the model are inversely normalized to ARGB color values in the range of integers from 0 to 255, and mapped one by one to 14 semantic color tokens to obtain an initial color matching scheme containing multiple semantic color tokens.
[0058] Extract all color combinations with foreground-background correspondence from the initial color scheme, resulting in 7 semantic foreground-background color pairs. For each color combination, calculate the relative brightness of the foreground and background colors: first, linearize each channel of the sRGB color values, dividing those below a threshold of 0.03928 by 12.92, and those above the threshold by ((v+0.055) / 1.055). 2.4 The relative brightness values are obtained by transforming and summing them according to the standard weighting coefficients; the contrast ratio is calculated based on the relative brightness of the foreground and background, using the formula (max(L1,L2)+0.05) / (min(L1,L2)+0.05), where L1 is the relative brightness of the brighter color and L2 is the relative brightness of the darker color; the contrast ratio of each color combination is compared with the preset compliance standard, and color combinations that do not meet the AA level contrast requirements are marked.
[0059] Iterate through all color combinations marked as not meeting the preset compliance standards, obtain the relative brightness of the background color in each combination, and determine whether the relative brightness of the background color is greater than 0.179. If it is greater, correct the corresponding foreground color to pure black; if it is less than or equal to, correct the corresponding foreground color to pure white, ensuring that the corrected color pair achieves the highest contrast. Integrate all the corrected color tokens to obtain the final color scheme that conforms to the target style and meets accessibility compliance requirements.
[0060] Step S202: Input the style semantic vector into the preset icon model to generate a vector icon set with a unified style.
[0061] It is understandable that the preset icon model can refer to a lightweight conditional diffusion model deployed on the device side. Using the geometric skeleton information of vector icons and style semantic vectors as joint conditional inputs, it can generate vector icon path data adapted to the target style while preserving the semantic recognizability of the icons. A vector icon set can refer to a collection of icons formed after stylizing all vector icons within the application. Each icon uses the Vector Drawable format, and while retaining the original functional semantics and recognizability, the overall design adapts to the target visual style.
[0062] In the specific implementation, all original vector icon resources within the application are traversed and obtained. The pathData in the XML definition of each vector icon is parsed one by one. The coordinates of the key control points of the path and the topological connection relationship between the path segments are extracted. The corresponding geometric skeleton information is constructed for each icon. The coordinate sequence of the geometric skeleton is normalized to the range of [0,1] and fused with the style semantic vector as a joint condition input. The preset icon model is passed in to generate a vector icon set with a unified style.
[0063] Furthermore, in order to complete the unified style conversion of all icons while preserving the original topological structure and functional semantics of the icons, and to avoid rendering anomalies caused by illegal paths, thereby producing a vector icon set with a unified style, clear recognition, and stable rendering, and providing reliable icon resource support for the overall visual consistency of the theme, step S202 includes: obtaining the original vector icons to be stylized, and extracting the geometric skeleton information of the original vector icons, wherein the geometric skeleton information includes the coordinates of path control points and the topological connection relationship between path segments; fusing the geometric skeleton information and the style semantic vector as joint conditions input to the preset icon model, wherein the preset icon model generates vector path data adapted to the target style under the constraint of preserving the topological structure and semantic recognizability of the icons; performing a legality check on the generated vector path data, and generating a vector icon set with a unified style based on the legality check result.
[0064] It should be understood that the original vector icon can refer to a pre-built Vector Drawable format icon resource within the application, based on XML-defined path data, carrying the icon's original functional semantics and geometric structure. Geometric skeleton information can refer to the structured geometric representation extracted from the original vector icon's path data, including the coordinates of path control points and the topological connections between path segments, used to constrain the structural boundaries of the generated icon and ensure semantic recognizability. Path control point coordinates can refer to the key coordinate points constituting the vector icon's path, corresponding to the positional parameters in the SVG path command, determining the icon's geometric shape and line direction. Topological connections can refer to the connection logic between various path segments in the vector icon, such as the correspondence between the path's start and end points, and closure relationships. Semantic recognizability means that after stylization, the icon retains its original functional meaning and visual recognizability, allowing users to quickly identify the icon's corresponding function without cognitive confusion due to style adjustments. Vector path data can refer to the icon's geometric data represented in the form of an SVG path command sequence, corresponding to the `pathData` attribute of `VectorDrawable`.
[0065] In the specific implementation, all Vector Drawable resources within the application are traversed, and a list of resource IDs for all vector icons is obtained through reflection. The pathData attribute in the XML definition of each vector icon is parsed one by one, and the type of SVG path command and the corresponding control point coordinates are identified one by one. The connection logic between each path segment is sorted out, the correspondence between the start and end points of the path and the closure attribute are clarified, and the topological connection relationship between the path segments is extracted. The control point coordinates and topological connection relationship are integrated to construct a corresponding geometric skeleton information structure for each original vector icon.
[0066] The coordinates of control points in the geometric skeleton information are normalized to the range of [0,1]. The normalized skeleton coordinate sequence is concatenated and fused with the style semantic vector to form a joint conditional input. The joint conditional input is fed into a preset icon model. The model, constrained by preserving the icon's topological structure and semantic recognizability, adjusts the coordinate positions of each control point according to the guidance of the style semantic vector and outputs a new coordinate sequence that adapts to the target style. The coordinate sequence output by the model is converted and reconstructed into vector path data in the standard SVG path command format.
[0067] Two validity checks are performed on each generated vector path data: first, path closure check, which checks whether each move path command corresponds to a valid closure command; second, coordinate range check, which checks whether all coordinate values are within the valid range of the viewport width and height. For vector path data that passes the checks, the original icon path is replaced with the new path. For vector path data that fails the checks, a degradation strategy is implemented, and the original vector icon path data is retained unchanged. All processed vector icons are summarized to form a vector icon set with a unified style.
[0068] Step S203: Input the style semantic vector into the preset background model to generate a background image that matches the theme.
[0069] It should be understood that the preset background model can refer to the SDXL-Turbo distilled version quantization model deployed on the device side, which combines text semantic embedding vectors and style semantic vectors as conditional inputs, and can generate decorative background images that adapt to the theme style through inference. The background image can refer to a decorative background image generated by the AI model, which is adapted to the overall tone of the theme in terms of color temperature, texture style and visual complexity, and is used as a background display resource for the application interface.
[0070] Furthermore, in order to generate background images that conform to semantic expectations on the device side, thereby ensuring the style consistency of background resources with color schemes and icon resources, improving the completeness of the theme resource package, and enhancing the overall visual coordination and personalized expression capabilities of the intelligently generated theme, step S203 includes: encoding the scene description text in the multimodal parameters into a text semantic embedding vector; concatenating the text semantic embedding vector with the style semantic vector and inputting it into the preset background model to generate a background image that matches the theme.
[0071] It is understandable that the text semantic embedding vector can refer to the high-dimensional feature vector obtained after the scene description text is encoded by the CLIP text encoder. It carries the semantic and style information of the text and is used to guide the output direction of the background generation model.
[0072] In the specific implementation, scene description text is extracted from multimodal parameters, and BPE segmentation is performed on the text to convert it into a token sequence that the model can recognize. The token sequence is input to the lightweight CLIP text encoder on the end side, and after passing through multiple layers of Transformer self-attention operation, the deep semantic features of the text are extracted. The features output by the encoder are dimensionally normalized to obtain a fixed-dimensional text semantic embedding vector, which is used as a condition constraint for subsequent image generation.
[0073] The text semantic embedding vector is concatenated with the 64-dimensional style semantic vector to form a complete joint conditional input containing semantic information and style constraints. The joint conditional input is fed into a preset background model, which performs fast denoising inference in 1 to 4 steps and outputs a three-channel floating-point image tensor of a specified resolution. The floating-point values of each pixel in the image tensor in the range of [0,1] are converted into bitmap data in ARGB format to obtain a background image with color tone, texture style and overall theme matching.
[0074] Step S204: Generate a theme resource package based on the color scheme, the vector icon set, and the background image.
[0075] In the specific implementation, three types of resources—color schemes, vector icon sets, and background images—are collected and generated in parallel. These three types of resources are then encapsulated in a structured manner to generate a theme resource package.
[0076] This embodiment utilizes three parallel AI generation methods—color scheme generation, vector icon set generation, and background image generation—to simultaneously produce complete theme resources of three types on the device side, using a unified style semantic vector as a shared constraint. This eliminates the need for manual pre-production by designers and cloud service support, thereby enabling real-time generation of complete theme resource packages, reducing theme customization costs, and improving the theme's personalized adaptability and generation efficiency.
[0077] Reference Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the visual theme switching method of this application. Based on the above embodiments, a third embodiment of the visual theme switching method of this application is proposed.
[0078] In the third embodiment, step S10 includes: Step S101: In response to the theme generation instruction, parse the theme generation instruction to obtain brand color parameters, scene description text and style tag parameters.
[0079] It should be understood that brand color parameters can refer to the brand's primary color values extracted from the theme generation instructions. These values can be RGB color values in Hex format, derived from the brand logo or official brand visual specifications. Scene description text can refer to a semantic description of the theme scene and style in natural language, such as expressions like "warm autumn day" or "technological deep blue," used to convey abstract style intentions and guide the generation of theme visual effects that conform to semantic expectations. Style tag parameters can refer to predefined enumerated target style identifiers, corresponding to preset style categories, used to quickly specify the overall style tone of the theme.
[0080] In the specific implementation, in response to the externally triggered theme generation command, the command data packet is parsed in a structured manner; three types of parameters with different modalities are extracted from the parsed command data, including brand color parameters in Hex format, scene description text in natural language form, and style tag parameters in predefined enumeration form; the extracted three types of parameters are subjected to format validation and normalization processing to ensure that the parameter format and numerical range meet the input requirements of the subsequent encoding module.
[0081] Step S102: Perform feature encoding on the brand color parameters, scene description text, and style tag parameters respectively to obtain color feature vector, scene feature vector, and style feature vector.
[0082] Understandably, a color feature vector can refer to a vector representation obtained by encoding the brand's color parameters, generated through color space transformation and normalization, carrying the color attribute features of the brand's primary color. A scene feature vector can refer to a vector representation obtained by semantically encoding the scene description text, carrying the deep semantic and stylistic features corresponding to the natural language description. A style feature vector can refer to a vector representation obtained by encoding the style tag parameters, generated through embedding lookup tables, carrying the feature attributes of the corresponding style category, used to define the overall style direction of the theme.
[0083] In the specific implementation, for the brand color parameters, a color space conversion operation is performed to convert the RGB color values to the LAB color space, and then numerical normalization is performed to obtain a 3D color feature vector. For the scene description text, the CLIP text encoder on the client side is called to perform semantic encoding to obtain a 384-dimensional high-dimensional semantic embedding vector, which is then subjected to dimensionality reduction processing by a lightweight multilayer perceptron network to obtain an intermediate-dimensional scene feature vector. For the style tag parameters, a lookup operation is performed through a pre-trained embedding table to map the enumerated tags to the corresponding dense feature vector representation to obtain the style feature vector.
[0084] Step S103: Perform concatenation and fusion operations on the color feature vector, the scene feature vector, and the style feature vector to generate a style semantic vector with a unified dimension.
[0085] In the specific implementation, the color feature vector, scene feature vector, and style feature vector are concatenated to obtain a concatenated high-dimensional fusion feature. The concatenated high-dimensional fusion feature is then input into a fully connected layer for feature fusion operation. Weights are assigned and features are fused to the features of different modalities to eliminate feature differences between modalities. The output is a style semantic vector with a unified 64-dimensional dimension, which serves as the shared condition input for the subsequent parallel generation branches of color scheme, icon, and background.
[0086] This embodiment uses instruction parsing parameter extraction, modal independent encoding, and cross-modal feature fusion to uniformly map the inputs of three heterogeneous modalities—brand color, natural language description, and style tags—to the same dimensional style latent space, forming standardized shared style constraints. This provides consistent style guidance for the subsequent three parallel generation branches, ensuring style coordination of various theme resources from the generation source and laying the foundation for intelligent generation of a complete theme resource package with unified style on the edge.
[0087] In the third embodiment, step S30 includes: Step S301: Based on the theme resource package, switch the visual theme on the terminal side through the View system rendering mode.
[0088] It should be understood that the View system rendering mode can refer to the traditional view rendering architecture of the Android platform, which executes the measurement, layout, and drawing process to render the interface through a hierarchical View tree, and relies on the system's Resources system to complete the loading and calling of resources.
[0089] Further, step S301 includes: constructing a target resource implementation instance containing color, icon and background resource mapping relationships according to the theme resource package; replacing the original resource implementation instance in the current context with the target resource implementation instance through a reflection mechanism, so that the resource system loads the target theme resource; when the resource system loads the target theme resource, traversing the view tree of the current interface, triggering view re-layout and drawing, so as to switch the visual theme on the terminal side.
[0090] In the specific implementation, all semantic color tokens of the color scheme are extracted from the theme resource package, and a ColorStateList mapping table is constructed to map the system's native color resource IDs to the AI-generated theme color values; the path data of all stylized vector icons are extracted from the theme resource package, and a Vector Drawable resource replacement table is constructed to map the original icon resource IDs to the vector path data of the new style; decorative background images are extracted from the theme resource package and encapsulated into corresponding Drawable resources; the above three types of resource mapping relationships are integrated to construct a complete target resource implementation instance, namely the new ResourcesImpl instance.
[0091] By using reflection, the reference to the private field mResourcesImpl inside the current context Resources object is obtained, and the original resource implementation instance is retrieved. The value of the mResourcesImpl field of the Resources object is set to the newly constructed target resource implementation instance, thus replacing the underlying resource loading instance. This switches the system's resource access chain from the original instance to the target resource implementation instance, and all subsequent resource loading requests will return the corresponding resource of the target topic.
[0092] Get the root view of the current Activity, traverse the entire view tree of the interface, and cover all levels of view controls; call the requestLayout method in turn for each view in the view tree, triggering the view tree to re-execute the measurement and layout process to adapt to the size and layout attributes of the new theme resources; call the invalidate method in turn for each view in the view tree, triggering the view tree to re-execute the drawing process to draw the new colors, icons, and background resources onto the interface, and finally complete the switching of the visual theme on the client side.
[0093] Step S302: Alternatively, switch the visual theme on the client side based on the theme resource package using the Compose system rendering mode.
[0094] It is understandable that the Compose rendering mode can refer to the modern declarative UI rendering architecture of the Android platform, which builds the interface through declarative descriptions of composable functions, updates the interface based on a state-driven reorganization mechanism, and manages theme parameters uniformly through MaterialTheme.
[0095] Further, step S302 includes: converting the color scheme in the theme resource package into semantic theme parameters that can be adapted to the composable framework, and encapsulating them into theme state data; updating the theme state data through a reactive state flow to trigger the composable components referencing the theme to perform reorganization; and completing the full-interface theme resource synchronization update within the component reorganization cycle to switch the visual theme on the device side.
[0096] In the specific implementation, all semantic color tokens conforming to the Material Design 3 specification are extracted from the theme resource package; the ARGB color values of each color token are converted one by one into Color type objects that can be natively adapted to the composable framework; according to the semantic layering rules of the Compose theme, the converted color parameters are mapped to standard theme attributes such as primary color, secondary color, surface color, and background color; all adapted semantic theme parameters are integrated and encapsulated to generate theme state data that can be observed by the Compose state system.
[0097] The global theme state data is updated by using MutableState, replacing the original state value with the newly encapsulated target theme state. The theme state change event is synchronously distributed to all composable components that have subscribed to the theme state by relying on the notification mechanism of the reactive state stream. All composable components that reference MaterialTheme are triggered to enter the reorganization process, preparing to re-render the interface content according to the latest theme state.
[0098] During the recombination cycle of composable components, the latest theme state data is reread to obtain all semantic parameters of the target theme; the new theme parameters are applied to all UI elements that depend on theme resources, covering all visual components such as text color, control background, icon color, and page background; the recombination rendering of all composable components on the entire interface is completed, and all visual elements are synchronously switched to the target theme style, finally completing the switching of the visual theme on the client side.
[0099] This embodiment uses two theme switching methods to adapt to different rendering architectures: View system resource reflection replacement and Compose system state-driven reorganization. This allows for simultaneous compatibility with two rendering modes on the Android platform. Combined with a frame synchronization mechanism, it achieves flicker-free, Activity-free hot-switching, thereby improving the scenario coverage of the solution. It can be seamlessly applied to various traditional View architecture and modern Compose architecture Android applications, ensuring a smooth user experience for dynamic theme switching.
[0100] For ease of understanding, please refer to Figure 4 This explanation is provided, but does not limit the scope of this application. Figure 4 This is an overall flowchart of an embodiment of the visual theme switching method of this application. As an example, the technical solution of this application is deployed on an Android device and consists of six core modules working together: ThemeGenEngine, ColorSchemeGenerator, VectorIconStylizer, BackgroundImageGen, StyleConsistencyGuard, and ResourceHotSwapper.
[0101] The overall data flow is as follows: S1: Topic generation instruction reception and style semantic encoding: ThemeGenEngine receives theme generation instructions. First, StyleConsistencyGuard fuses and encodes the multimodal conditional inputs (brand color, scene semantics, style description) into a unified style semantic vector. Then, three AI generation branches are launched in parallel: edge color scheme diffusion generation (S2), vector icon skeleton extraction and conditional diffusion stylization (S3), and decorative background image generation (S4). The three share the style semantic vector as conditional input. S2: End-side color scheme diffusion generation: The color scheme generation branch takes the brand's main color RGB value and a 64-dimensional style semantic vector as joint input conditions, and generates a complete color scheme that conforms to the Material Design 3 color token system through an edge-side conditional VAE distillation model (parameter count <3M).
[0102] S3: Vector Icon Skeleton Extraction and Conditional Diffusion Stylization The vector icon stylization branch comprises three sub-stages: skeleton extraction, conditional diffusion reasoning, and path reconstruction verification.
[0103] S4: Generating decorative background images: The background image generation branch uses style semantic vectors and scene description text as joint conditions to generate decorative background images that fit the current theme through a lightweight image generation model on the edge (a TFLite quantized version of the SDXL-Turbo distillation version).
[0104] S5: Style Consistency Validation and Conflict Resolution Once the three branches are completed, StyleConsistencyGuard verifies the style consistency of the three branches in a unified style implicit space, and automatically triggers regeneration for branches that deviate from the overall style. S6: Dynamic replacement of ResourcesImpl and hot switching of Compose theme reorganization: Finally, the theme resource package that passes the consistency check is injected into the Android resource system by ResourceHotSwapper, and hot switching without restart is achieved through dynamic replacement of ResourcesImpl (View system) or update of MaterialTheme state (Compose system).
[0105] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the visual theme switching method of this application. Any simple transformations based on this technical concept are all within the protection scope of this application.
[0106] This application also provides a visual theme switching device, please refer to... Figure 5 The visual theme switching device includes: The vector generation module 10 is used to extract multimodal parameters from the topic generation instruction in response to the topic generation instruction, and fuse and encode the multimodal parameters into a style semantic vector; The resource package generation module 20 is used to call a preset artificial intelligence model, input the style semantic vector into the preset artificial intelligence model, and generate a theme resource package; Theme switching module 30 is used to switch the visual theme on the terminal side based on the theme resource package.
[0107] The visual theme switching device provided in this application, employing the visual theme switching method described in the above embodiments, solves the technical problem that related visual theme switching methods require designers to pre-create multiple complete theme resource packages, resulting in the theme content being completely fixed after publication and unable to be dynamically adjusted according to user preferences or scene changes. Compared with the prior art, the beneficial effects of the visual theme switching device provided in this application are the same as those of the visual theme switching method provided in the above embodiments, and other technical features in the visual theme switching device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0108] This application provides a visual theme switching device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the visual theme switching method in the first embodiment described above.
[0109] The following is for reference. Figure 6 This document illustrates a structural schematic diagram of a visual theme switching device suitable for implementing embodiments of this application. The visual theme switching device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The visual theme switching device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0110] like Figure 6As shown, the visual theme switching device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the visual theme switching device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touch screens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, LCDs (Liquid Crystal Displays), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the visual theme switching device to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show visual theme switching devices with various systems, it should be understood that implementing or having all of the systems shown is not required. More or fewer systems may be implemented alternatively.
[0111] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0112] The visual theme switching device provided in this application, employing the visual theme switching method described in the above embodiments, solves the technical problem that related visual theme switching methods require designers to pre-create multiple complete theme resource packages, resulting in the theme content being completely fixed after release and unable to be dynamically adjusted according to user preferences or scene changes. Compared with the prior art, the beneficial effects of the visual theme switching device provided in this application are the same as those of the visual theme switching method provided in the above embodiments, and other technical features of this visual theme switching device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0113] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0114] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0115] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the visual theme switching method in the above embodiments.
[0116] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the above-described visual theme switching method. This solves the technical problem that related visual theme switching methods require designers to pre-create multiple complete theme resource packages, resulting in theme content being completely fixed after release and unable to be dynamically adjusted according to real-time user preferences or scene changes. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the visual theme switching method provided in the above embodiments, and will not be repeated here.
[0117] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the visual theme switching method as described above.
[0118] The computer program product provided in this application solves the technical problem that related visual theme switching methods require designers to create multiple complete theme resource packages in advance, resulting in the theme content being completely fixed after release and unable to be dynamically adjusted according to user preferences or scene changes in real time. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the visual theme switching method provided in the above embodiments, and will not be repeated here.
[0119] The above description is only a part of the embodiments of this application and does not limit the scope of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application specification and drawings, or direct / indirect applications in other related technical fields, are included within the protection scope of this application.
[0120] It should be noted that the data collection, tag management, rule setting, and push decision-making processes involved in this application are designed to work with other technical features to solve technical problems. They do not involve or support any illegal activities. Any data processing that may violate laws and regulations (such as unauthorized collection of privacy data, generation of discriminatory tags, setting unfair rules, or pushing illegal information) is not within the scope of protection of this application's technical solution. Of course, the user data in this application will be encrypted, anonymized, or de-identified before storage to ensure user data security.
[0121] This application discloses A1, a method for switching visual themes, the method comprising: In response to a topic generation instruction, multimodal parameters are extracted from the topic generation instruction, and the multimodal parameters are fused and encoded into a style semantic vector; The style semantic vector is input into a preset artificial intelligence model to generate a theme resource package; The visual theme on the device is switched based on the aforementioned theme resource package.
[0122] A2. The visual theme switching method as described in A1, wherein the preset artificial intelligence model includes a preset color scheme model, a preset icon model, and a preset background model; the step of inputting the style semantic vector into the preset artificial intelligence model to generate a theme resource package includes: The style semantic vector is input into the preset color model to generate a color scheme that matches the target style. The style semantic vector is input into the preset icon model to generate a vector icon set with a unified style; The style semantic vector is input into the preset background model to generate a background image that matches the theme. A theme resource package is generated based on the color scheme, the vector icon set, and the background image.
[0123] A3. The visual theme switching method as described in A2, wherein inputting the style semantic vector into the preset color scheme model to generate a color scheme that conforms to the target style includes: The brand color parameters in the multimodal parameters are concatenated with the style semantic vector and then input into the preset color model to generate an initial color scheme containing multiple semantic color tokens. Perform contrast verification on the color combinations in the initial color scheme, where the color combinations are a combination of foreground and background colors; Based on the contrast verification results, color combinations that do not meet the preset compliance standards are corrected to obtain a color scheme that conforms to the target style.
[0124] A4. The visual theme switching method as described in A2, wherein inputting the style semantic vector into the preset icon model to generate a vector icon set with a unified style includes: Obtain the original vector icon to be stylized, and extract the geometric skeleton information of the original vector icon. The geometric skeleton information includes the coordinates of the path control points and the topological connection relationship between the path segments. The geometric skeleton information and the style semantic vector are fused into a joint condition input to the preset icon model. The preset icon model generates vector path data that adapts to the target style while preserving the icon topology and semantic recognizability. Perform a validity check on the generated vector path data, and generate a vector icon set with a unified style based on the validity check results.
[0125] A5. The visual theme switching method as described in A2, wherein inputting the style semantic vector into the preset background model to generate a background image adapted to the theme includes: The scene description text in the multimodal parameters is encoded into a text semantic embedding vector; The text semantic embedding vector and the style semantic vector are concatenated and then input into the preset background model to generate a background image that matches the theme.
[0126] A6. The visual theme switching method as described in any one of A1 to A5, wherein switching the visual theme on the endpoint based on the theme resource package includes: Based on the aforementioned theme resource package, the visual theme on the client side is switched using the View system rendering mode; Alternatively, the visual theme on the client side can be switched using the Compose rendering mode based on the theme resource package.
[0127] A7. The visual theme switching method as described in A6, wherein switching the terminal-side visual theme based on the theme resource package through the View system rendering mode includes: Construct a target resource implementation instance that includes color, icon, and background resource mapping relationships based on the theme resource package; Based on the target resource implementation instance, the original resource implementation instance in the current context is replaced by the reflection mechanism, so that the resource system loads the target theme resource; When the resource system loads the target theme resource, it traverses the view tree of the current interface, triggering view re-layout and redrawing to switch the visual theme on the client side.
[0128] A8. The visual theme switching method as described in A6, wherein switching the visual theme on the client side based on the theme resource package through the Compose system rendering mode includes: The color schemes in the theme resource package are converted into semantic theme parameters that can be adapted to the composable framework and encapsulated as theme status data; The topic state data is updated by a reactive state stream, triggering the composable components referencing the topic to perform reorganization. During the component reorganization cycle, the entire interface theme resources are synchronized and updated to switch the visual theme on the client side.
[0129] A9. The visual theme switching method as described in any one of A1 to A5, further comprising, before switching the end-side visual theme based on the theme resource package: Perform style consistency checks on all types of resources within the theme resource package and identify resource branches that deviate from the target style; Resource branches that deviate from the target style are regenerated to obtain a target theme resource package that meets style consistency constraints. Accordingly, the switching of the visual theme on the device side based on the theme resource package includes: switching the visual theme on the device side based on the target theme resource package.
[0130] A10. The visual theme switching method as described in A9, wherein performing style consistency verification on various resources within the theme resource package and identifying resource branches that deviate from the target style includes: The style features of each type of resource in the theme resource package are extracted separately, and the style features are encoded into resource style vectors of corresponding dimensions; Calculate the similarity between each resource style vector and the style semantic vector, and identify resource branches with similarity below a preset threshold as resource branches that deviate from the target style.
[0131] A11. The visual theme switching method as described in any one of A1 to A5, wherein the step of extracting multimodal parameters from the theme generation instruction in response to the theme generation instruction and fusing and encoding the multimodal parameters into a style semantic vector includes: In response to the theme generation command, the theme generation command is parsed to obtain brand color parameters, scene description text and style tag parameters; Feature encoding is performed on the brand color parameters, scene description text, and style tag parameters respectively to obtain color feature vectors, scene feature vectors, and style feature vectors; The color feature vector, the scene feature vector, and the style feature vector are concatenated and fused to generate a style semantic vector with a unified dimension.
[0132] This application also discloses B12, a visual theme switching device, the visual theme switching device comprising: A vector generation module is used to extract multimodal parameters from a topic generation instruction in response to the topic generation instruction, and fuse and encode the multimodal parameters into a style semantic vector; The resource package generation module is used to call a preset artificial intelligence model, input the style semantic vector into the preset artificial intelligence model, and generate a theme resource package; The theme switching module is used to switch the visual theme on the terminal side based on the theme resource package.
[0133] B13. The visual theme switching device as described in B12, wherein the preset artificial intelligence model includes a preset color scheme model, a preset icon model, and a preset background model; the resource package generation module is further configured to input the style semantic vector into the preset color scheme model to generate a color scheme that conforms to the target style; input the style semantic vector into the preset icon model to generate a vector icon set with a unified style; input the style semantic vector into the preset background model to generate a background image that matches the theme; and generate a theme resource package based on the color scheme, the vector icon set, and the background image.
[0134] B14. In the visual theme switching device described in B13, the resource package generation module is further configured to concatenate the brand color parameters in the multimodal parameters with the style semantic vector and input them into the preset color matching model to generate an initial color scheme containing multiple semantic color tokens; perform contrast verification on the color combinations in the initial color scheme, wherein the color combination is a combination of foreground and background colors; and correct color combinations that do not meet the preset compliance standards based on the contrast verification results to obtain a color scheme that conforms to the target style.
[0135] B15. In the visual theme switching device described in B13, the resource package generation module is further configured to acquire the original vector icon to be stylized, and extract the geometric skeleton information of the original vector icon, wherein the geometric skeleton information includes the coordinates of path control points and the topological connection relationship between path segments; fuse the geometric skeleton information with the style semantic vector as a joint condition input to the preset icon model, wherein the preset icon model generates vector path data adapted to the target style under the constraint of preserving the icon topological structure and semantic recognizability; perform legality verification on the generated vector path data, and generate a vector icon set with a unified style based on the legality verification result.
[0136] B16. In the visual theme switching device described in B13, the resource package generation module is further configured to encode the scene description text in the multimodal parameters into a text semantic embedding vector; and to input the text semantic embedding vector and the style semantic vector into the preset background model to generate a background image that matches the theme.
[0137] B17. The visual theme switching device as described in any one of B12 to B16, wherein the theme switching module is further configured to switch the terminal-side visual theme based on the theme resource package through the View system rendering mode; or, to switch the terminal-side visual theme based on the theme resource package through the Compose system rendering mode.
[0138] This application also discloses C18, a visual theme switching device, the visual theme switching device comprising: a memory, a processor, and a visual theme switching program stored in the memory and executable on the processor, wherein the visual theme switching program, when executed by the processor, implements the visual theme switching method as described above.
[0139] This application also discloses D19, a storage medium storing a visual theme switching program, which, when executed by a processor, implements the visual theme switching method as described above.
[0140] This application also discloses E20, a computer program product including a visual theme switching program, which, when executed by a processor, implements the visual theme switching method as described above.
Claims
1. A method for switching visual themes, characterized in that, The visual theme switching method includes: In response to a topic generation instruction, multimodal parameters are extracted from the topic generation instruction, and the multimodal parameters are fused and encoded into a style semantic vector; The style semantic vector is input into a preset artificial intelligence model to generate a theme resource package; The visual theme on the device is switched based on the aforementioned theme resource package.
2. The visual theme switching method as described in claim 1, characterized in that, The preset artificial intelligence model includes a preset color scheme model, a preset icon model, and a preset background model; The step of inputting the style semantic vector into the preset artificial intelligence model to generate a theme resource package includes: The style semantic vector is input into the preset color model to generate a color scheme that matches the target style. The style semantic vector is input into the preset icon model to generate a vector icon set with a unified style; The style semantic vector is input into the preset background model to generate a background image that matches the theme. A theme resource package is generated based on the color scheme, the vector icon set, and the background image.
3. The visual theme switching method as described in claim 2, characterized in that, The step of inputting the style semantic vector into the preset color model to generate a color scheme that conforms to the target style includes: The brand color parameters in the multimodal parameters are concatenated with the style semantic vector and then input into the preset color model to generate an initial color scheme containing multiple semantic color tokens. Perform contrast verification on the color combinations in the initial color scheme, where the color combinations are a combination of foreground and background colors; Based on the contrast verification results, color combinations that do not meet the preset compliance standards are corrected to obtain a color scheme that conforms to the target style.
4. The visual theme switching method as described in claim 2, characterized in that, The step of inputting the style semantic vector into the preset icon model to generate a vector icon set with a unified style includes: Obtain the original vector icon to be stylized, and extract the geometric skeleton information of the original vector icon. The geometric skeleton information includes the coordinates of the path control points and the topological connection relationship between the path segments. The geometric skeleton information and the style semantic vector are fused into a joint condition input to the preset icon model. The preset icon model generates vector path data that adapts to the target style while preserving the icon topology and semantic recognizability. Perform a validity check on the generated vector path data, and generate a vector icon set with a unified style based on the validity check results.
5. The visual theme switching method as described in claim 2, characterized in that, The step of inputting the style semantic vector into the preset background model to generate a background image adapted to the theme includes: The scene description text in the multimodal parameters is encoded into a text semantic embedding vector; The text semantic embedding vector and the style semantic vector are concatenated and then input into the preset background model to generate a background image that matches the theme.
6. The visual theme switching method as described in any one of claims 1 to 5, characterized in that, The switching of the visual theme on the terminal side based on the theme resource package includes: Based on the aforementioned theme resource package, the visual theme on the client side is switched using the View system rendering mode; Alternatively, the visual theme on the client side can be switched using the Compose rendering mode based on the theme resource package.
7. A visual theme switching device, characterized in that, The visual theme switching device includes: A vector generation module is used to extract multimodal parameters from a topic generation instruction in response to the topic generation instruction, and fuse and encode the multimodal parameters into a style semantic vector; The resource package generation module is used to call a preset artificial intelligence model, input the style semantic vector into the preset artificial intelligence model, and generate a theme resource package; The theme switching module is used to switch the visual theme on the terminal side based on the theme resource package.
8. A visual theme switching device, characterized in that, The visual theme switching device includes: a memory, a processor, and a visual theme switching program stored in the memory and executable on the processor, wherein the visual theme switching program, when executed by the processor, implements the visual theme switching method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores a visual theme switching program, which, when executed by a processor, implements the visual theme switching method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a visual theme switching program, which, when executed by a processor, implements the visual theme switching method as described in any one of claims 1 to 6.
