ComposeGears / ComposeGears/Valkyrie

[Preview] contextual tint

Open
#1,063 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
889
Forks
26
Avg merge
36m
Merged PRs (30d)
2

Description

I have currently a set of icons which are driven by external tint...

internal fun AppIcons.Influences.acidReflux(tintColor: Color): ImageVector =
    ImageVector.Builder(
        name = "acid-reflux",
        defaultWidth = 24.dp,
        defaultHeight = 24.dp,
        viewportWidth = 24f,
        viewportHeight = 24f,
    ).apply {
        path(fill = SolidColor(tintColor)) {
            ...
        }
        path(fill = SolidColor(Color.White)) {
            ...
        }
    }.build()

apparently this fails, because it needs a color,

  • deafult argument for tintColor should work
  • a color picker for this would nice...

and then having this

val AppIcons.Remedies.AirPurifier: ImageVector
    get() {
        _airPurifier?.let { return it }
        return AppIcons.Influences.airPurifier(Color(0xFFFF0000)).also { _airPurifier = it }
    }

private var _airPurifier: ImageVector? = null

doesn't work, with "no preview found"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the no-preview-found behavior with the parameterized ImageVector and cached AirPurifier examples in the issue. Inspect the previewer entry point and its handling of icon parameters and generated properties; done means tint-driven icons can preview with a default or selected color.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.