-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use image color when add layer to napari (#1200)
Use color associated with the channel in napari reader plugin. <!-- Generated by sourcery-ai[bot]: start summary --> ## Summary by Sourcery Add functionality to use channel-associated colors in napari layers by adjusting hex color codes. Enhance the `_hex_to_rgb` function to support additional hex code formats and update tests accordingly. New Features: - Integrate color adjustment for image layers in the napari reader plugin, using the color associated with the channel. Enhancements: - Improve the `_hex_to_rgb` function to handle 4 and 8 character hex codes, ensuring proper conversion and validation. Tests: - Expand tests for the `_hex_to_rgb` function to include cases for 4 and 8 character hex codes, ensuring correct functionality and error handling. <!-- Generated by sourcery-ai[bot]: end summary --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced `adjust_color` function to modify color strings based on length, enhancing color handling. - Updated `_hex_to_rgb` function to support additional hexadecimal color formats. - **Bug Fixes** - Improved validation for hex color codes, ensuring robust error handling for various input lengths. - **Tests** - Added new test cases for `_hex_to_rgb` to validate behavior with hex codes including alpha channels. - Enhanced tests for layer creation and colormap validation in image processing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
7 changed files
with
110 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters