Skip to content
Snippets Groups Projects
Commit 779d1dc5 authored by Melissa Belkacemi's avatar Melissa Belkacemi
Browse files

Update couleur.py

parent 2b0564c3
Branches
No related tags found
No related merge requests found
#Belkacemi Melissa
#13/03/2024
# 31/03/2024
def couleur_moyenne(liste:list[tuple[int,int,int]])->tuple[int,int,int]:
"""déterminer la couleur moyenne d'une liste de couleurs sous la forme (r,g,b)
......@@ -28,7 +28,7 @@ def coul_sont_proches(coul1:tuple[int,int,int],coul2:tuple[int,int,int])->bool:
renvoie True si les distances entre r1 et r2, v1 et v2, et b1 et b2
est inférieure à 10
Précondition :
Précondition : les couleurs sont correctes
Exemple(s) :
$$$ coul_sont_proches((145,145,130),(140,136,132))
True
......@@ -44,4 +44,4 @@ def coul_sont_proches(coul1:tuple[int,int,int],coul2:tuple[int,int,int])->bool:
"""
r1,v1,b1=coul1
r2,v2,b2=coul2
return (abs(r1-r2)<=10 and abs(v1-v2)<=10 and abs(b1-b2)<=10)
\ No newline at end of file
return (abs(r1-r2)<=10 and abs(v1-v2)<=10 and abs(b1-b2)<=10)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment