Coverage for pyguymer3/image/rgb2name.py: 12%

8 statements  

« prev     ^ index     » next       coverage.py v7.10.3, created at 2025-08-16 08:31 +0000

1#!/usr/bin/env python3 

2 

3# Define function ... 

4def rgb2name(r, g, b, /): 

5 """ 

6 This function says if one channel is brighter than the others in an RGB 

7 triplet. 

8 """ 

9 

10 # Catch channel ... 

11 if r > g and r > b: 

12 return "redish" 

13 

14 # Catch channel ... 

15 if g > r and g > b: 

16 return "greenish" 

17 

18 # Catch channel ... 

19 if b > r and b > g: 

20 return "blueish" 

21 

22 # Set default ... 

23 return "it's complicated"