@@ -376,13 +376,24 @@ def clear_rect(x_start:float, y_start:float, width:float, height:float):
376376def set_colour (red :int , green :int , blue :int ):
377377 """
378378 Sets the color of the shape(s) that follow in the program until another color is set.
379-
380-
381- Category: TI Draw / Control
382-
383-
384- Returns an array / list: [red, green, blue]
379+
380+ Args:
381+ red (int): The amount of red. Ranges from 0 to 255.
382+ green (int): [description]
383+ blue (int): [description]
384+
385+ Returns:
386+ list: a list containing the following data: [red, green, blue]
385387 """
388+ if cerr .type_error (int , red ) == False : log ("Argument 'red' has to be type integer!" , "ERROR" , "TI Draw" , "Set Colour" )
389+ if cerr .type_error (int , green ) == False : log ("Argument 'green' has to be type integer!" , "ERROR" , "TI Draw" , "Set Colour" )
390+ if cerr .type_error (int , blue ) == False : log ("Argument 'blue' has to be type integer!" , "ERROR" , "TI Draw" , "Set Colour" )
391+
392+ if cerr .range_error (0 , 255 , red ) == False : log ("Argument 'red' has to be between the values 0 and 255!" , "ERROR" , "TI Draw" , "Set Colour" )
393+ if cerr .range_error (0 , 255 , green ) == False : log ("Argument 'green' has to be between the values 0 and 255!" , "ERROR" , "TI Draw" , "Set Colour" )
394+ if cerr .range_error (0 , 255 , blue ) == False : log ("Argument 'blue' has to be between the values 0 and 255!" , "ERROR" , "TI Draw" , "Set Colour" )
395+
396+
386397 err .type_error (int , "int" , red )
387398 err .type_error (int , "int" , green )
388399 err .type_error (int , "int" , blue )
@@ -392,7 +403,7 @@ def set_colour(red:int, green:int, blue:int):
392403 err .range_error (0 , 255 , blue )
393404
394405
395-
406+ log ( "Setting drawing colour to red '" + str ( red ) + "', green '" + str ( green ) + "', blue '" + str ( blue ) + "'" , "INFO" , "TI Draw" , "Set Colour" )
396407 print ("Setting drawing colour to red '" + str (red ) + "', green '" + str (green ) + "', blue '" + str (blue ) + "'" )
397408 return [red , green , blue ]
398409
0 commit comments