compose-vectorize
1.3.0indexedGenerates `ImageVector` from `.xml` files, supporting theme attributes and dynamic colors for easy integration into Compose code. Automatically categorizes images by subfolder.
Generates `ImageVector` from `.xml` files, supporting theme attributes and dynamic colors for easy integration into Compose code. Automatically categorizes images by subfolder.
A Kotlin Multiplatform library to generate compose.ui.graphics.vector.ImageVector from .xml files.
Visit the project website for documentation.
Create a folder called xml-images in the module folder.
:module/xml-images
You can manually generate ImageVector for these XML files by calling gradle generateImages. This will create a Kotlin file for each XML file containing the ImageVector in the build folder.
Now, you can use reference this image in the Compose code:
Icon(Images.Icons.Add, contentDescription = null)
Note that automatically a category called "Icons" has been created. A category is created for each subfolder in xml-images folder.
It also supports theme attributes. If you are using theme color attributes, like ?attr/colorPrimary
or ?attr/colorSecondary, they can be converted to Compose MaterialTheme tokens, which means that
you can update illustration colors based on the token values. It is also compatible with Material3 dynamic colors.
It also supports theme attributes. If you are using theme color attributes, like ?attr/colorPrimary
or ?attr/colorSecondary, they can be converted to Compose MaterialTheme tokens, which means that
you can update illustration colors based on the token values. It is also compatible with Material3 dynamic colors.
<path
android:pathData="..."
android:fillColor="?attr/colorPrimary"/>
[!NOTE]
It requires use Compose Material 3 dependency.
Copyright 2024 Sergio Belda
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance the License.
You may obtain a copy of the License at
http:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.
Surfaced from shared tags and platforms — no rankings paid for.