From 0df31b29ab7661f7119bf8c9bfa259c4ea41de63 Mon Sep 17 00:00:00 2001 From: Dariya Kinadinova <dariya.kinadinova.etu@univ-lille.fr> Date: Mon, 1 Apr 2024 00:24:13 +0200 Subject: [PATCH] change of name --- projet/codes/color_manipulation.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/projet/codes/color_manipulation.py b/projet/codes/color_manipulation.py index 99b8b10..feeefcc 100644 --- a/projet/codes/color_manipulation.py +++ b/projet/codes/color_manipulation.py @@ -46,17 +46,17 @@ def avg_col(l:list) -> tuple(): (236, 210, 111) """ - c1 = 0 - c2 = 0 - c3 = 0 + r = 0 + g = 0 + b = 0 for col in l: - c1 += col[0] - c2 += col[1] - c3 += col[2] - avg1 = c1 // len(l) - avg2 = c2 // len(l) - avg3 = c3 // len(l) - return (avg1, avg2, avg3) + r += col[0] + g += col[1] + b += col[2] + avg_r = r // len(l) + avg_g = g // len(l) + avg_b = b // len(l) + return (avg_r, avg_g, avg_b) def list_col(im: Image, left_top: tuple(), right_bottom: tuple()) -> list[int]: """Renvoie une liste de tuples de couleurs pour chaque pixel de la région spécifiée de l'image. -- GitLab