Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c365224

Browse filesBrowse files
committed
force rgb colors to be a triplet of integers, not floats
1 parent 1f38da0 commit c365224
Copy full SHA for c365224

File tree

1 file changed

+4
-2
lines changed
Filter options

1 file changed

+4
-2
lines changed

‎plotly/tools.py

Copy file name to clipboardExpand all lines: plotly/tools.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4562,10 +4562,12 @@ def _endpts_to_intervals(endpts):
45624562
@staticmethod
45634563
def _convert_to_RGB_255(colors):
45644564
"""
4565-
Multiplies each element of a triplet by 255
4565+
Multiplies each element of a triplet by 255 and rounds to nearest int
45664566
"""
45674567

4568-
return (colors[0]*255.0, colors[1]*255.0, colors[2]*255.0)
4568+
return (int(colors[0]*255.0),
4569+
int(colors[1]*255.0),
4570+
int(colors[2]*255.0))
45694571

45704572
@staticmethod
45714573
def _n_colors(lowcolor, highcolor, n_colors):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.