Skip to content

This project demonstrates a simple, visually engaging animation in Android using Jetpack Compose. It features a square that rotates infinitely and cycles smoothly through a vibrant spectrum of colors. The animation uses rememberInfiniteTransition, graphicsLayer, and HSV color interpolation for a modern, gamified UI effect.

Notifications You must be signed in to change notification settings

hariiomp/SpinningColor

Repository files navigation

Spinning Colorful Square Animation – Jetpack Compose

A simple and visually appealing Jetpack Compose demo featuring an infinite spinning and color-shifting square. The project showcases modern animation APIs and vibrant HSV color interpolation for a playful, “gamified” effect. Perfect as a splash screen, loading UI, or Compose animation reference.

✨ Features

  • Infinite Smooth Rotation: The square continuously rotates using Compose animation APIs.

  • Dynamic Color Cycling: Color transitions smoothly across the HSV spectrum for a rainbow effect.

  • Minimal, Reusable Composable: Core animation is just a single @Composable function.

  • Material 3 Structure: Clean, up-to-date app structure using Surface and MaterialTheme.

📸 Preview

Screen.Recording.2025-09-15.at.9.53.33.AM.mov

🛠️ Tech Stack

  • Language: Kotlin
  • UI Toolkit: Jetpack Compose
  • Animation: Compose Animation Core
  • Design System: Material 3 (Compose)

📦 Setup

  • Clone this repo.
  • Open in Android Studio.
  • Make sure your build.gradle Compose dependencies align with the latest stable Compose version.
  • Build and run on an emulator or device.

🧑‍💻 Customization

  • Change the size() for a different square dimension.
  • Adjust the animationSpec or color values for speed and feel.
  • Embed the SpinningColorfulSquare() inside your own UI or as a loading/splash animation.

📄 License

This project is licensed under the MIT License — feel free to use, modify, and share!

🙏 Acknowledgements

Inspired by Jetpack Compose’s infiniteTransition and HSV animation possibilities.

About

This project demonstrates a simple, visually engaging animation in Android using Jetpack Compose. It features a square that rotates infinitely and cycles smoothly through a vibrant spectrum of colors. The animation uses rememberInfiniteTransition, graphicsLayer, and HSV color interpolation for a modern, gamified UI effect.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages