Skip to content

Repository files navigation

ChromaFlow

ChromaFlow brings line-based images to life with a sweeping neon glow that flows across your artwork. A colored light band sweeps continuously over the image, masked precisely to every opaque pixel — so the effect follows the exact shape of lines, edges, and fine details.

Note: ChromaFlow currently supports line-only images with no background (e.g. neon signs, circuit boards, outline illustrations). Support for other image types may be added in future releases.

License API

한국어

Mobile Wear OS

chromaflow-sample — Mobile sample / app — Wear OS sample

Features

  • Sweeping glow effect — a colored light band sweeps across the image, visible only on opaque pixels
  • Lifecycle-aware — animation automatically pauses when the app goes to background or AOD mode, and resumes on RESUMED
  • Highly customizable — glow color, base tint, direction, speed, gradient width, easing, and alpha
  • Recomposition-efficient — animation reads only inside the Canvas draw phase, skipping full composition
  • Zero dependencies beyond Jetpack Compose

Installation

Add JitPack to your project-level settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        maven { url = uri("https://jitpack.io") }
    }
}

Then add the dependency to your module-level build.gradle.kts:

dependencies {
    implementation("com.github.M1n9yu23:ChromaFlow:<version>")
}

Replace <version> with the latest release tag.

Usage

Basic

ChromaFlowImage(
    painter = painterResource(R.drawable.my_image),
    contentDescription = "Sample image",
    style = ChromaFlowStyle(glowColor = Color.Cyan),
    modifier = Modifier.fillMaxSize(),
)

Full customization

ChromaFlowImage(
    painter = painterResource(R.drawable.my_image),
    contentDescription = null,
    modifier = Modifier.size(300.dp),
    style = ChromaFlowStyle(
        glowColor = Color.Cyan,
        baseColor = Color.DarkGray,
        durationMillis = 1500,
        glowAlpha = 0.8f,
        gradientWidth = 200.dp,
        direction = ChromaFlowDirection.LEFT_TO_RIGHT,
        easing = FastOutSlowInEasing,
    ),
)

ChromaFlowStyle

Parameter Type Default Description
glowColor Color Color.Unspecified Color of the sweeping glow. Unspecified disables animation.
baseColor Color Color.Unspecified Tint applied over the source image. Unspecified keeps the original.
durationMillis Int 2500 Duration of one sweep pass in milliseconds.
glowAlpha Float 0.9f Peak opacity of the glow at the gradient center (0f1f).
gradientWidth Dp 300.dp Width of the sweeping gradient band.
direction ChromaFlowDirection BIDIRECTIONAL Direction of the sweep.
easing Easing LinearEasing Easing curve applied to each sweep pass.

ChromaFlowDirection

Value Description
LEFT_TO_RIGHT Sweeps from left edge to right edge, then instantly resets.
RIGHT_TO_LEFT Sweeps from right edge to left edge, then instantly resets.
BIDIRECTIONAL Sweeps left → right → left continuously (default).

ChromaFlowDefaults

Reference defaults when partially overriding a style:

ChromaFlowStyle(
    glowColor = Color.Magenta,
    durationMillis = ChromaFlowDefaults.DURATION_MILLIS / 2, // twice as fast
)
Constant Value
DURATION_MILLIS 2500
GLOW_ALPHA 0.9f
gradientWidth 300.dp
direction ChromaFlowDirection.BIDIRECTIONAL
easing LinearEasing

Requirements

  • Android API 24+
  • Jetpack Compose

Contributing

All contributions are welcome — bug fixes, new animation styles, or even expanding support beyond line-based images. If you have a great idea or improvement, feel free to open a pull request or issue.

See CONTRIBUTING.md for details.

Support

If ChromaFlow has been useful to you, consider giving it a ⭐ — it means a lot!

License

Copyright 2026 Gyugle

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.

About

A lifecycle-aware, recomposition-efficient sweeping glow animation library for Jetpack Compose.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages