Skip to content

test: add unit tests for rgb/hex color conversion helpers#5659

Open
eeshsaxena wants to merge 1 commit into
plotly:mainfrom
eeshsaxena:test/colors-helpers
Open

test: add unit tests for rgb/hex color conversion helpers#5659
eeshsaxena wants to merge 1 commit into
plotly:mainfrom
eeshsaxena:test/colors-helpers

Conversation

@eeshsaxena

Copy link
Copy Markdown

Description

The rgb/hex color-conversion helpers in _plotly_utils/colors were not directly covered. This adds tests/test_core/test_colors/test_color_conversions.py covering:

  • hex_to_rgb for basic hex values
  • label_rgb formatting a tuple and unlabel_rgb parsing it back (and their round-trip)
  • find_intermediate_color at the midpoint, at both endpoints, and with colortype="rgb"

No source changes.

Verification

pytest tests/test_core/test_colors/test_color_conversions.py - 7 passed. black clean.

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.

1 participant