# Color Scale Broke

**URL:** <https://community.plotly.com/t/color-scale-broke/66177>\
**Category:** Dash Python\
**Created:** [July 17, 2022, 10:38am UTC](https://community.plotly.com/t/color-scale-broke/66177 "2022-07-17T10:38:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![russmcb](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/russmcb/32/12147_2.png) [@russmcb](https://community.plotly.com/u/russmcb)\
**Post date:** [July 17, 2022, 10:38am UTC](https://community.plotly.com/t/color-scale-broke/66177/1 "2022-07-17T10:38:01Z")

</div>

Not sure what happened but my color scale ‘broke’ without me changing any of the code… maybe due to a module update… Now I can’t get _any_ custom color scale to work nor any Plotly built-in scale, like ‘hot’. This is what was working for a long time, live now at [http://www.policekillings.info](http://www.policekillings.info).

scale\_colors=[ “rgb(255,255,255)”, “rgb(254,178,76)”, “rgb(252,78,42)”, “rgb(189,0,38)”, “rgb(189,0,38)”,  
“rgb(189,0,38)”,“rgb(189,0,38)”,“rgb(128,0,38)”, “rgb(128,0,38)”]  
…  
color\_continuous\_scale=scale\_colors,  
…

But now my map is not using my color scale and is instead falling back to the default Plotly blue, purple, orange, yellow scale. So, color\_continuous\_scale setting is entirely being ignored for some reason.

Any ideas appreciated!

  
  
  
  
Full figure settings for reference:

fig = px.choropleth(  
data\_frame=df,  
locationmode=‘USA-states’,  
locations=‘StateCode’,  
scope=“usa”,  
color=per\_million,  
range\_color=(0,199), # This keeps the color key consistent between different race data  
color\_continuous\_scale=scale\_colors,  
template=‘plotly\_dark’,  
hover\_name=‘State’  
)  
fig.update\_layout(  
yaxis={‘automargin’:True,},  
xaxis={‘automargin’:True},  
geo=dict(bgcolor=‘#202b38’, lakecolor=‘#4E5D6C’),  
paper\_bgcolor=‘#202b38’,  
plot\_bgcolor=‘#202b38’,  
width=920,  
height=500,  
dragmode=False,  
hoverlabel=dict(  
font\_size=16,  
bgcolor=‘#202b38’,  
bordercolor=‘#FFFFFF’,  
align=‘left’,  
font\_color=‘white’  
),  
coloraxis\_colorbar=dict(  
title=“Number of People  
Killed Per Million”,  
titleside=‘top’,  
thicknessmode=“pixels”, thickness=30,  
lenmode=“pixels”, len=300,  
yanchor=“bottom”, y=0.27,  
xanchor=“left”, x=-0.05,  
),  
)
