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

New colour generator #23638

Merged
merged 1 commit into from
Apr 3, 2016
Merged

Conversation

skjnldsv
Copy link
Contributor

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @MorrisJobke, @rullzer and @Kondou-ger to be potential reviewers

@skjnldsv skjnldsv force-pushed the new-placeholder-colours-generator branch from 50f5d20 to dd7ab16 Compare March 30, 2016 05:10
@MorrisJobke MorrisJobke added this to the 9.1-current milestone Mar 30, 2016
@MorrisJobke
Copy link
Contributor

Tested and works 👍

@skjnldsv skjnldsv force-pushed the new-placeholder-colours-generator branch from 0a61c25 to d1cba54 Compare March 30, 2016 08:48
@skjnldsv
Copy link
Contributor Author

Rebased with a small fix for hash detection.

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 1, 2016

@jancborchardt review?

@rullzer
Copy link
Contributor

rullzer commented Apr 1, 2016

That is a lot of computation for just a simple color 😕

I did not look at the code in to much detail (yet) but I like to make sure that this can be done (easily) in the same way on the mobile and desktop clients as well. Because we want to show the same colors there for placeholders.

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 1, 2016

The code is longer than the previous one for sure, but not very heavy.
I'm pretty sure there are many other ways to compute hashes into evenly distributed colors, but hey, at least this one works! :)

Do you want me to do some benchmarking?


// Placeholders are square
height = this.height() || size || 32;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height does not seem to be defined. Can you define it before?

@LukasReschke
Copy link
Member

👍 once #23638 (diff) is fixed


// Already a md5 hash?
if( !hash.match(/^[0-9a-f]{32}$/g) ) {
var hash = md5(hash);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like hash was already defined. The var is not needed here.

@rullzer
Copy link
Contributor

rullzer commented Apr 1, 2016

@skjnldsv no I'm fine but it was just a 'woah' moment ;)

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 1, 2016

@rullzer I was too curious, so I did it anyway!
benchmark

This shouldn't be a that much of a deal ;)

@skjnldsv skjnldsv force-pushed the new-placeholder-colours-generator branch from 66d1226 to dcc28a3 Compare April 1, 2016 16:01
@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 1, 2016

@LukasReschke Rebased with the requested fixes.

@georgehrke
Copy link
Contributor

👍 this is good to go now imo

@jancborchardt
Copy link
Member

@skjnldsv can you show screenshots of a bunch of generated colors before and after? Like a sample from the user mgmt with avatars? :)

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 2, 2016

Sure
users owncloud
users owncloud2

@jancborchardt
Copy link
Member

Cool, definitely more readable and less intense! 👍

@skjnldsv can you then make sure that anywhere we use generated colors (Mail app account colors, Contacts, profile picture placeholders, etc) this new generator is used?

@jancborchardt jancborchardt merged commit a0e2eae into master Apr 3, 2016
@jancborchardt jancborchardt deleted the new-placeholder-colours-generator branch April 3, 2016 10:26
@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 3, 2016

@jancborchardt I will look into it yeah!

@jancborchardt
Copy link
Member

@skjnldsv thanks! :)

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 3, 2016

Mail seems good, core too with users list.
Need to make a pr for the contact app.

I may have missed something tho :)

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 4, 2016

@jancborchardt We should separate the function that convert the hash into a hsl color from the dom manipulation (height, width, text...) because we might want to use it for other things than an avatar. Like the contact header color for example.

@jancborchardt
Copy link
Member

@skjnldsv cool! Other places which come to mind are:

  • profile pictures in the sharing section of the sidebar
  • Activity app as well as in the sidebar
  • Maps app feature of showing contacts on the map (PR needed, cc @v1r0x)

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 4, 2016

I'm checking it right now.
ps: see #23768

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 4, 2016

Activities: ok
Comments: ok
User profile: ok
Sharing: can't get it to work, no user appear on the list when i type some letters, strange.
Map: doesn't seem to work, when clicking contact, the app request the contact addressbook but the url doesn't exist so it's being redirected to /files (302 moved)

@jancborchardt
Copy link
Member

Ah yeah, @v1r0x the endpoint for Contacts moved with 9.0, cc @DeepDiver1975 @Henni

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Apr 5, 2016

Sharing: ok

@lock
Copy link

lock bot commented Aug 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants