@@ -393,7 +393,7 @@ def validate_scale_values(scale):
393
393
)
394
394
395
395
396
- def make_colorscale (colors , scale = None , colorscale = None ):
396
+ def make_colorscale (colors , scale = None ):
397
397
"""
398
398
Makes a colorscale from a list of colors and a scale
399
399
@@ -406,8 +406,7 @@ def make_colorscale(colors, scale=None, colorscale=None):
406
406
407
407
:param (list) colors: a list of single colors
408
408
"""
409
- if colorscale is None :
410
- colorscale = []
409
+ colorscale = []
411
410
412
411
# validate minimum colors length of 2
413
412
if len (colors ) < 2 :
@@ -459,7 +458,7 @@ def unconvert_from_RGB_255(colors):
459
458
colors [2 ]/ (255.0 ))
460
459
461
460
462
- def convert_to_RGB_255 (colors , rgb_components = None ):
461
+ def convert_to_RGB_255 (colors ):
463
462
"""
464
463
Multiplies each element of a triplet by 255
465
464
@@ -472,8 +471,7 @@ def convert_to_RGB_255(colors, rgb_components=None):
472
471
:param (list) rgb_components: grabs the three R, G and B values to be
473
472
returned as computed in the function
474
473
"""
475
- if rgb_components is None :
476
- rgb_components = []
474
+ rgb_components = []
477
475
478
476
for component in colors :
479
477
rounded_num = decimal .Decimal (str (component * 255.0 )).quantize (
@@ -561,23 +559,21 @@ def hex_to_rgb(value):
561
559
for i in range (0 , hex_total_length , rgb_section_length ))
562
560
563
561
564
- def colorscale_to_colors (colorscale , color_list = None ):
562
+ def colorscale_to_colors (colorscale ):
565
563
"""
566
564
Extracts the colors from colorscale as a list
567
565
"""
568
- if color_list is None :
569
- color_list = []
566
+ color_list = []
570
567
for item in colorscale :
571
568
color_list .append (item [1 ])
572
569
return color_list
573
570
574
571
575
- def colorscale_to_scale (colorscale , scale_list = None ):
572
+ def colorscale_to_scale (colorscale ):
576
573
"""
577
574
Extracts the interpolation scale values from colorscale as a list
578
575
"""
579
- if scale_list is None :
580
- scale_list = []
576
+ scale_list = []
581
577
for item in colorscale :
582
578
scale_list .append (item [0 ])
583
579
return scale_list
0 commit comments