# gpui: Make HSLA functions const \(\#61682\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/63b52a7ee354741a7485e8a20ab087a485fcb8a1)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 63b52a7ee354741a7485e8a20ab087a485fcb8a1

Requested commit: 63b52a7ee354741a7485e8a20ab087a485fcb8a1

Commit: 63b52a7ee354741a7485e8a20ab087a485fcb8a1

Tree: d32f2b18b77adb583a94746012c95f00dd045f95

Author: shenghaiyang

Committer: GitHub

## Message

```
gpui: Make HSLA functions const (#61682)

# Objective

Make hsla functions `const`.

## Solution

Made Hsla-related functions `const fn`.

## Testing

> Did you test these changes? If so, how?

Ran `cargo test -p gpui color` to verify the color-related tests pass.

> Are there any parts that need more testing?

No additional testing is required since this change only changes
existing color functions to `const fn`.

> How can other people (reviewers) test your changes? Is there anything
specific they need to know?
 
Reviewers can run `cargo test -p gpui color` to verify the changes.

> If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?

Tested on macOS. No platform-specific behavior is expected.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- N/A
```

## Parents

- [5a020093f5bfb59f3bb683ff28686f97b6d7b9c8](https://git.cafe/gitcafe/zed/commit/5a020093f5bfb59f3bb683ff28686f97b6d7b9c8?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/63b52a7ee354741a7485e8a20ab087a485fcb8a1?format=markdown)
