logo

Crowdly

Soit le code suivant provenant de ColorSys , une librairie Core de CPython. ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Soit le code suivant provenant de ColorSys, une librairie Core de CPython.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

# HSV: Hue, Saturation, Value

# H: position in the spectrum

# S: color saturation ("purity")

# V: color brightness

def rgb_to_hsv

(r, g, b):

maxc

= max

(r, g, b)

minc

= min

(r, g, b)

rangec

= (maxc-

minc)

v

=

maxc

if minc ==

maxc:

return 0.0, 0.0

, v

s

= rangec /

maxc

rc

= (maxc-r) /

rangec

gc

= (maxc-g) /

rangec

bc

= (maxc-b) /

rangec

if r ==

maxc:

h

= bc-

gc

elif g ==

maxc:

h

= 2.0+rc-

bc

else

:

h

= 4.0+gc-

rc

h

= (h/6.0) % 1.0

return

h, s, v

Déterminer un oracle métamorphique pour cette fonction. 

HSV est un système de couleur qui exprime la plage de couleur différemment de RGB.

More questions like this

Want instant access to all verified answers on moodle.polymtl.ca?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!