Skip to content

display color as hex string in color_sliders.py#14395

Merged
mosc9575 merged 4 commits into
branch-3.8from
14393_fix_inconsistent_lableling_in_color_slider_example
Mar 12, 2025
Merged

display color as hex string in color_sliders.py#14395
mosc9575 merged 4 commits into
branch-3.8from
14393_fix_inconsistent_lableling_in_color_slider_example

Conversation

@mosc9575

@mosc9575 mosc9575 commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

The change results in showing color as RGB.

grafik

@bryevdv Do you think it is a good idea to show color as rbg and hex? If not this is fixed and can be marked as ready.

@mosc9575 mosc9575 added this to the 3.8 milestone Mar 7, 2025
@mattpap mattpap changed the base branch from branch-3.7 to branch-3.8 March 7, 2025 08:32
@bryevdv

bryevdv commented Mar 11, 2025

Copy link
Copy Markdown
Member

I suppose this is fine but personally I preferred seeing the hex color codes, also that's what's in the gallery thumbnail. If there is any easy way to fix this in that other direction, I think that is preferable. (I was not clear in the issue, but the tuple showing up initially is the new and different change, i.e. the "bug". Previously it always showed a hex code, even initially)


# create a data source to enable refreshing of fill & text color
source = ColumnDataSource(data=dict(color=[color], text_color=[text_color]))
source = ColumnDataSource(data=dict(color=[color], color_string=[color], text_color=[text_color]))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must be missing something, but where color_string is consumed?

@mosc9575

Copy link
Copy Markdown
Contributor Author

I will push an update which will start with a hex string and does not introduce color_string.
The inital plot will be

color_slider

@bryevdv bryevdv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I suppose LGTM tho I do wonder what the reason we can't just use the hex string directly for the text color as well?

@mosc9575

mosc9575 commented Mar 12, 2025

Copy link
Copy Markdown
Contributor Author

I do wonder what the reason we can't just use the hex string directly for the text color as well?

There was no good reason except to keep the change minimal. To be consistent I changed the text_color to the hex string #ffffff.

@mosc9575 mosc9575 merged commit 72ec331 into branch-3.8 Mar 12, 2025
@mosc9575 mosc9575 changed the title add color_string to show rgb as string in color_sliders.py display color as hex string in color_sliders.py Mar 12, 2025
@mattpap mattpap deleted the 14393_fix_inconsistent_lableling_in_color_slider_example branch March 12, 2025 08:14
@mosc9575 mosc9575 mentioned this pull request Mar 25, 2025
10 tasks
mattpap pushed a commit that referenced this pull request Mar 25, 2025
* add color_string to show rgb as sting in color_sliders.py

* show hex instead of rgb

* simplify

* start with hex color for text_color
@mattpap mattpap modified the milestones: 3.8, 3.7.1 Mar 25, 2025
@github-actions

github-actions Bot commented Jul 9, 2025

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color sliders example has inconsistent labeling

3 participants