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

feat: allow construct Style constantly #64

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tisonkun
Copy link

@tisonkun tisonkun commented Aug 5, 2024

No description provided.

@fdncred
Copy link

fdncred commented Aug 5, 2024

For what purpose? We recently closed these similar PRs.
#60
#61

@tisonkun
Copy link
Author

tisonkun commented Aug 5, 2024

My highlighter has a const color and I'd configure the color as a const.

Of course it's possible to initialize once at runtime and reuse the field, but I saw other existing const fns like:

  • pub const fn reset_before_style(&self) -> Style
  • pub const fn bold(&self) -> Style
  • pub const fn dimmed(&self) -> Style
  • pub const fn italic(&self) -> Style
  • pub const fn underline(&self) -> Style
  • pub const fn blink(&self) -> Style
  • pub const fn reverse(&self) -> Style
  • pub const fn hidden(&self) -> Style
  • pub const fn strikethrough(&self) -> Style
  • pub const fn fg(&self, foreground: Color) -> Style
  • pub const fn on(&self, background: Color) -> Style

So why not for new as it's in the same situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants