Giter Club home page Giter Club logo

compose-vectorize's Introduction

Compose Vectorize

Maven Central

A Kotlin Multiplatform library to generate compose.ui.graphics.vector.ImageVector from .xml files.

Visit the project website for documentation.

Usage

Create a folder called xml-images in the module folder.

:module/xml-images

Android

Captura de pantalla 2024-01-05 a las 16 57 56

Multiplatform

Captura de pantalla 2024-01-05 a las 17 10 28

Generate 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.

Captura de pantalla 2024-01-05 a las 17 00 45

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.


Themed Attributes

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"/>
Screenshot_20240310_145842 Screenshot_20240310_145842-2 Screenshot_20240310_145842-1

Note

It requires use Compose Material 3 dependency.


License

   Copyright 2024 Sergio Belda

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

compose-vectorize's People

Contributors

renovate[bot] avatar serbelga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

goooler

compose-vectorize's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • actions/setup-java v4
  • macos 14
.github/workflows/deploy-docs.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/setup-python v5
  • actions/configure-pages v5
  • gradle/gradle-build-action v3
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4
  • macos 14
gradle
gradle.properties
settings.gradle.kts
build.gradle.kts
compose-vectorize-core/build.gradle.kts
compose-vectorize-gradle-plugin/build.gradle.kts
gradle/libs.versions.toml
  • com.android.tools.build:gradle 8.5.1
  • androidx.activity:activity-compose 1.9.1
  • androidx.compose:compose-bom 2024.06.00
  • androidx.core:core-ktx 1.13.1
  • org.jetbrains.kotlin:kotlin-gradle-plugin 2.0.0
  • com.diffplug.spotless:spotless-plugin-gradle 6.25.0
  • com.squareup:kotlinpoet 1.18.1
  • xpp3:xpp3 1.1.4c
  • xmlpull:xmlpull 1.1.3.4a
  • com.android.application 8.5.1
  • com.android.library 8.5.1
  • org.jetbrains.kotlin.plugin.compose 2.0.0
  • org.jetbrains.compose 1.6.11
  • com.gradle.plugin-publish 1.2.1
  • org.jetbrains.kotlin.android 2.0.0
  • app.cash.paparazzi 1.3.4
  • com.diffplug.spotless 6.25.0
  • com.vanniktech.maven.publish 0.29.0
gradle/build-logic/settings.gradle.kts
gradle/build-logic/convention/build.gradle.kts
sample/gradle.properties
sample/settings.gradle.kts
sample/build.gradle.kts
sample-mpp/gradle.properties
sample-mpp/settings.gradle.kts
sample-mpp/build.gradle.kts
sample-mpp/android/build.gradle.kts
sample-mpp/common/build.gradle.kts
sample-mpp/desktop/build.gradle.kts
sample-mpp/web/build.gradle.kts
sample/app/build.gradle.kts
gradle-wrapper
gradle/build-logic/gradle/wrapper/gradle-wrapper.properties
  • gradle 8.9
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.9
sample-mpp/gradle/wrapper/gradle-wrapper.properties
  • gradle 8.9
sample/gradle/wrapper/gradle-wrapper.properties
  • gradle 8.9

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.