Skip to content

Theming: compute the primary color based on the background image #34560

Closed

Description

@PVince81

@skjnldsv I think you said you had an idea how to do this ?

can you post your ideas / concepts here ?

I guess the code in question (hopefully a library) will need to process all pixels of the image

Activity

  1. added this to the Nextcloud 26 milestone on Oct 12, 2022
  2. PVince81 commented on Oct 12, 2022

    @PVince81
    MemberAuthor

    currently as an alternative we will let the user pick the primary color themselves: #34437

  3. self-assigned this
    on Oct 13, 2022
  4. skjnldsv commented on Oct 13, 2022

    @skjnldsv
    Member

    This require an extra step:

    1. Separate the config between background and color. So we can have BOTH a custom bg AND a custom colour.

    Then we can address this.

  5. jancborchardt commented on Oct 20, 2022

    @jancborchardt
  6. added and removed
    1. to developAccepted and waiting to be taken care of
    on Oct 20, 2022
  7. skjnldsv commented on Oct 20, 2022

    @skjnldsv
  8. skjnldsv commented on Oct 20, 2022

    @skjnldsv
    Member

    @jancborchardt @nimishavijay I'm gonna use this library https://jariz.github.io/vibrant.js/
    It generate a few type of colour from an image, please tell me which of the following I should use as primary:

    • Vibrant
    • Muted
    • DarkVibrant
    • DarkMuted
    • LightVibrant
    • LightMuted

    image

  9. skjnldsv commented on Oct 20, 2022

    @skjnldsv
    Member

    I guess the difference is if we want an "accent" colour or more like an "average" colour.
    I would go for Vibrant (personal preference), otherwise Muted seems to be good ? 🤷

  10. nimishavijay commented on Oct 20, 2022

    @nimishavijay
    Member

    My vote would be for DarkVibrant. With Muted my worry is that

    • there might not be enough contrast between text and bg
    • it seems more like an "average" color of all the colors in the picture, so there's less of a direct association between the color and the picture

    I also like Vibrant, but in some of the pictures (like the one with the cat) it doesn't seem like a prominent color at all, but it is chosen as primary simply because it "pops" the most.

    Another possible idea for the future: in the color picker for theming your account, show this list of colors as "Suggested colors based on your background" in addition to the default colors.

    cc @jancborchardt

  11. skjnldsv commented on Oct 20, 2022

    @skjnldsv
    Member

    Another possible idea for the future: in the color picker for theming your account, show this list of colors as "Suggested colors based on your background" in addition to the default colors.

    I could do that later yep :)
    Would need nextcloud-libraries/nextcloud-vue#3384

  12. jancborchardt commented on Oct 20, 2022

    @jancborchardt
    Member

    Yeah, I'm also unsure between Vibrant and DarkVibrant. The others I would for sure exclude.

    Vibrant seems great but not accessible as @nimishavijay said, so let's indeed go with DarkVibrant?

  13. 2 remaining items

  14. skjnldsv commented on Oct 21, 2022

    @skjnldsv
    Member

    Thank you both :)

  15. PVince81 commented on Oct 25, 2022

    @PVince81
    MemberAuthor

    WIP PR here: #34696

  16. PVince81 commented on Oct 25, 2022

    @PVince81
    MemberAuthor

    ~1 week of work to get it done but too risky and too involved for 25, so 26 then

  17. PVince81 commented on Oct 25, 2022

    @PVince81
    MemberAuthor

    to clarify: 25.0.1 will already have manual selection of primary color so the base requirement was already there
    so no feature regression

    and this automatic detection is "nice to have"

  18. skjnldsv commented on Nov 23, 2022

    @skjnldsv
    Member

    @jancborchardt @nimishavijay since we're taking DarkVibrant, the shipped background doesn't use the proper colours. Do you want to adjust them for 26 ?

    I made a quick tool to see what it would look like with DarkVibrant on our shipped backgrounds
    https://codesandbox.io/embed/vibrant-test-nextcloud-vrudvv?view=preview

  19. jancborchardt commented on Nov 28, 2022

    @jancborchardt
    Member

    @skjnldsv I think for the shipped backgrounds we should continue to use the preset colors we currently have. We generated them by using the Material Design customizer, and that works pretty well (might even be the best algorithm).

    The color generator with DarkVibrant of course we use for individual uploaded backgrounds. :)

  20. skjnldsv commented on Nov 28, 2022

    @skjnldsv
    Member

    Good from me! 👍
    Feel free to test and review #34696 then 😉

  21. te-online commented on Apr 22, 2023

    @te-online
    Contributor

    Maybe this is not the right place to discuss this, feel free to point me somewhere else.

    I can see how it's a nice feature to ship an accent color for the predefined background images, but when I upgraded to 25, I really felt like this was a bug.

    I had selected one of the default images (the big wheel) in a previous version and suddenly my accent color went from the one that I had set globally in the theming settings to a somewhat ugly brown (I know, that's subjective 😉)

    I thought, well, it's a nice feature, but I can probably change that – however, I can't seem to do that. Whenever I select this image as my background, it automatically sets the brown. Maybe I'm missing something?

    It feels like a regression that we don't allow users to select their accent color separately from the background image, if we're already doing introducing so many layers to the color/background settings... 🤓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions