Skip to content
This repository was archived by the owner on Jul 19, 2022. It is now read-only.

Add Hashvatars #298

Merged
merged 1 commit into from
Jan 7, 2022
Merged

Add Hashvatars #298

merged 1 commit into from
Jan 7, 2022

Conversation

hojberg
Copy link
Member

@hojberg hojberg commented Jan 6, 2022

Problem

We want recognizable project avatars.

Solution

CleanShot 2022-01-06 at 11 06 37@2x

Add Hashvatars to display a unique avatar from a Unison Hash for Projects using the Unison hexgrid and the design system colors.

Each color is picked by harmonizing the first picked color (for the background) via the full gamut colors and then approximating those colors to colors confined in the design system by using rgb difference.

Caveats/Notes

  • Down the line, this might change to a manual harmony map which is likely to produce a more pleasant combinations for colors

Inspired by https://github.com/wzulfikar/hashvatar

@hojberg hojberg requested a review from pchiusano January 6, 2022 16:06
--color-brand-orange: #ff8800;
--color-brand-yellow: #ffc41f;
--color-brand-purple: #8f228f;
--color-brand-dark-purple: #520066;
Copy link
Member Author

Choose a reason for hiding this comment

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

these were never used



view : Hash -> Html msg
view hash =
Copy link
Member Author

Choose a reason for hiding this comment

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

Its not the most efficient thing to do every time we want to render an avatar, but realistically we wont have hundreds on a page at the same time.



toGrid : List Int -> Maybe HexGrid.HexGrid
toGrid slots =
Copy link
Member Author

Choose a reason for hiding this comment

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

This function feels a bit gnarly. Its mostly due to having to deal with optionality when getting elements in the list by index, even though we know the size of the list with a guarantee.

Add Hashvatars to display a unique avatar from a Unison Hash for
Projects using the Unison hexgrid and the design system colors.

Each color is picked by harmonizing the first picked color (for the
background) via the full gamut colors and then approximating those
colors to colors confined in the design system by using rgb difference.
@hojberg hojberg merged commit e186e44 into main Jan 7, 2022
@hojberg hojberg deleted the hashvatars branch January 7, 2022 14:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant