Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Allow users to set their own accent color by passing in a color object #10

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

tinnet
Copy link
Contributor

@tinnet tinnet commented Sep 21, 2023

This enables users to use their own colors, e.g. from one of the many "resume color" guides on the internet (e.g. https://designshack.net/articles/graphics/resume-color-schemes/).

I decided to check the type of the passed in object instead of e.g. doing some magic string logic ala awesomeColor.starts-with("#"), seemed more robust this way.

This also still fails fast since either the user passed in a correct object, or it defaults back to the dictionary lookup that complains about any string that is not a present key -> the user can still be confused why passing in "neongreen" does not work, but no more than before this PR ;)

This does not create any circular dependencies since it requires no knowledge of the rest of the template - just base typst type/function.

object (e.g. created with rgb()).

This does not create any circular dependencies since it requires no
knowledge of the rest of the template - just base typst type/function.
@mintyfrankie
Copy link
Owner

Thanks @tinnet! Will update the submodule and the example repo very soon.

@mintyfrankie mintyfrankie merged commit f9cc4fa into mintyfrankie:main Sep 21, 2023
@tinnet tinnet deleted the allow-custom-accent-colors branch September 21, 2023 14:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants