Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Palette API #122

Closed
wants to merge 18 commits into from
Closed

Add a Palette API #122

wants to merge 18 commits into from

Conversation

Philip-Scott
Copy link
Member

@Philip-Scott Philip-Scott commented Oct 26, 2017

The Palette class is used to extract most dominant colors from an image

Demo:

You drag & drop an image, and it will analyze it

image

image

TODO:

  • Documentation
  • Demo
  • ???
  • Profit

@harisvsulaiman
Copy link

harisvsulaiman commented Oct 27, 2017

Edited: :-)

@Philip-Scott Taking cues from android and @donadigo Adam:-) . This might make some apps even more pleasant

@donadigo
Copy link
Collaborator

@harisvsulaiman or rather, me ;)

btkostner and others added 5 commits November 11, 2017 17:37
…ors; create generate_sync and generate_async methods; make properties public settable for further use; declare constants for max colors and quality properties
@cassidyjames
Copy link
Contributor

cassidyjames commented Nov 16, 2018

Because this has come up several times, I want to document the times/places accent colors have been brought up and when they make sense versus other color/blur utils:

Uses

Tinting for background protection

@danrabbit usually brings up that blur would probably work better. I think it's more an aesthetic choice; the tint is more subtle and is used in on other platforms like Android for a super subtle way to let the wallpaper affect the rest of the OS without the heavy-weight (and potentially disorienting) blur.

Home screen Lock screen Notifications shade Power menu
screenshot_20181116-112724 screenshot_20181116-112729 screenshot_20181116-112737 screenshot_20181116-112744

So far I don't know if we have explicit examples of where we would use this, especially with the new Greeter design.

Providing content-based fill

@danrabbit again usually brings up that blur would probably work better. In this case I think he is correct. An example is in a header for a music app, or as a way to fill a different size/aspect ratio without stretching an image.

Melody screenshot

I will say that if we had an accent color available to us, being able to factor in a tint in addition to/instead of blur might be interesting. iTunes, Android, and other places in macOS and iOS do this effectively in my opinion. See https://panic.com/blog/itunes-11-and-colors/ for some examples.

Twitter also does this for its fullscreen image viewer, though I'm not sure how effective it is (or how good their algorithm is):

screenshot_20181116-121259 screenshot_20181116-121305
screenshot_20181116-121318 screenshot_20181116-121329

UI accent colors

This is the most effective use of this API in my opinion. Sometimes a developer wants to provide more vibrant color in their UI (whether it's heading text, card backgrounds, etc.), and simply blurring out some piece of content doesn't make sense. This is where Android and Material design put this on display effectively.

Cards More Extensive
palette2 activity_transitions 1

Pocket Casts is my favorite example of this because it's subtle but effective. Their UI is super monotone, but all content-related accent colors are picked from the artwork.

simply elementary Vergecast Tomorrow Today Explained Android Police Android Central
screenshot_20181116-114544 screenshot_20181116-114635 screenshot_20181116-114649 screenshot_20181116-114656 screenshot_20181116-114718 screenshot_20181116-114800
screenshot_20181116-114613 screenshot_20181116-114628 screenshot_20181116-114645 screenshot_20181116-114701 screenshot_20181116-114715 screenshot_20181116-114804

Moving forward

I think a palette API would be awesome and useful to app developers. However! Like any of our Granite APIs, they have to be proven in use before we adopt them—app developers, this is your chance to do some interesting things and see how they go to potentially affect a feature in elementary OS! @Philip-Scott if this API would be useful, implement it in Spice-Up and see how it goes, what its limitations are, etc. If we find genuinely useful places to use it in an elementary project, let's implement it in that codebase! If we have more than one place, then let's look at pulling it into Granite.

@harisvsulaiman
Copy link

Is there anything preventing this from being merged? I would like to see this as part of elementary

@donadigo
Copy link
Collaborator

@harisvsulaiman it has conflicts and the API isn't even fininished yet.

@btkostner
Copy link

@harisvsulaiman

However! Like any of our Granite APIs, they have to be proven in use before we adopt them—app developers, this is your chance to do some interesting things and see how they go to potentially affect a feature in elementary OS! @Philip-Scott if this API would be useful, implement it in Spice-Up and see how it goes, what its limitations are, etc. If we find genuinely useful places to use it in an elementary project, let's implement it in that codebase! If we have more than one place, then let's look at pulling it into Granite.

@jeremypw
Copy link
Collaborator

@danrabbit Is this something you would like to see completed? It seems to have been abandoned but the initial reaction seemed positive.

@cassidyjames
Copy link
Contributor

@jeremypw the issue is that this is implementation-first instead of design-first. We're using a similar algorithm directly in Gala, I believe, to set the system accent color but I don't know anywhere else we've wanted to use a content-based accent color. Like anything else in Granite, we should work to implement it in the places we need it first and only accept it into Granite once we have multiple places we want to use it.

@jeremypw
Copy link
Collaborator

@cassidyjames Maybe an element of "chick and egg" here. More likely to be used if easily available in Granite? But I understand your pov. How do we monitor/count the places where it might be used?

@jeremypw
Copy link
Collaborator

I think this can be closed now - it seems thoroughly abandoned - at least until the API has been designed/implemented in one project.

@jeremypw jeremypw closed this Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants