# a3.py # YOUR NAME(S) AND NETID(S) HERE # THE DATE HERE """ Functions for Assignment A3 These functions are for creating transformed versions of RGB objects (colors). One format for such transformations is 3-item lists of 3-item lists. """ # Throughout, we use "number" to mean an item of type either float or int. def complement_rgb(rgb): """Returns: a new RGB object that is the complement of color <rgb>. Used as the color of the font in the color panels of the a3app application. Precondition: <rgb> is an RGB object""" pass # TODO: implement me! def list_to_rgb(clist): """Returns: a new RGB object whose components are specified by <clist>. The new object's red attribute will be clist[0], the green attribute will be clist[1], and the blue attribute will be clist[2]. Precondition: <clist> is a list of three ints in 0..255. (See colormodels.py for explanation of the ".." notation.""" # You may or may not find this to be a useful helper function in your # later code. But whether or not you choose to use it, you must implement it. pass # TODO: implement me! def rgb_to_string(rgb): """Returns: string representation of <rgb> in the form "(R, G, B)". Used to display the R, G, and B values in the application. Precondition: <rgb> is an RGB object""" # Be careful to get all the punctuation and spacing precisely correct. return '' # TODO: Implement me! def components_to_num(coeffs, rgb): """Returns: the linear combination specified by <coeffs> of <rgb'>s component values. This will be a single number. Preconditions: <coeffs> is a list of three numbers. <rgb> is an RGB object.""" return 0 # TODO: implement me! def apply_matrix(matrix, rgb): """Returns: a new color object resulting from applying <matrix> to color <rgb>. Precondition: <matrix> is a 3-item list, each item of which is a a 3-item list of numbers. <rgb> is an RGB object.""" # You should call Python's round() function pass # TODO: Implement me!