[PR #6841] [MERGED] PM-35925: bug: Update 'hexToColor' function to handle default names #55127

Closed
opened 2026-05-01 21:05:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/6841
Author: @david-livefront
Created: 4/27/2026
Status: Merged
Merged: 4/28/2026
Merged by: @david-livefront

Base: mainHead: PM-35925-hex-to-color-parser


📝 Commits (1)

  • fc69abe PM-35925: Update 'hexToColor' function to handle default names

📊 Changes

1 file changed (+11 additions, -5 deletions)

View changed files

📝 ui/src/main/kotlin/com/bitwarden/ui/platform/base/util/StringExtensions.kt (+11 -5)

📄 Description

🎟️ Tracking

PM-35925

📔 Objective

This PR updates the hexToColor() function to support default names (like teal).

Previously we assumed that the string value would always be a valid hex value with or without the #. We now only add the # prefix if the value is all digits, otherwise we let the text pass as is. This change allows the default name values such as teal to be parsed correctly. If an unsupported value is passed in, we will log the error and default to the color black.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/6841 **Author:** [@david-livefront](https://github.com/david-livefront) **Created:** 4/27/2026 **Status:** ✅ Merged **Merged:** 4/28/2026 **Merged by:** [@david-livefront](https://github.com/david-livefront) **Base:** `main` ← **Head:** `PM-35925-hex-to-color-parser` --- ### 📝 Commits (1) - [`fc69abe`](https://github.com/bitwarden/android/commit/fc69abe330e5f97fe5e6e227ec6cc2f30b51e39a) PM-35925: Update 'hexToColor' function to handle default names ### 📊 Changes **1 file changed** (+11 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `ui/src/main/kotlin/com/bitwarden/ui/platform/base/util/StringExtensions.kt` (+11 -5) </details> ### 📄 Description ## 🎟️ Tracking [PM-35925](https://bitwarden.atlassian.net/browse/PM-35925) ## 📔 Objective This PR updates the `hexToColor()` function to support default names (like teal). Previously we assumed that the string value would always be a valid hex value with or without the `#`. We now only add the `#` prefix if the value is all digits, otherwise we let the text pass as is. This change allows the default name values such as `teal` to be parsed correctly. If an unsupported value is passed in, we will log the error and default to the color black. [PM-35925]: https://bitwarden.atlassian.net/browse/PM-35925?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-01 21:05:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#55127