def rgb_to_hsb(r, g, b, *rest): # see https://en.wikipedia.org/wiki/HSB_color_space. HSB is also known as HSV. r, g, b = _clip1((r, g, b)) m1 = maximum(r, g, b) m0 = minimum(r, g, b) c = m1 - m0 eps = 1e-15 h = _compute_hsb_h(m1, c, eps, r, g, b) h = _wrap_hsb_h(h * (60. / 360.)) s = _compute_hsb_s(m1, c, eps) return (h, s, m1) + rest
def testMinimum(self): self.assertEqualArrays( minimum([[1, 2], [3, 4]], [[-1, 4], [-8, 5]], [[8, -4], [1, 10]]), [[-1, -4], [-8, 4]])
def testMinimum(self): self.assertEqualArrays(minimum( [[1, 2], [3, 4]], [[-1, 4], [-8, 5]], [[8, -4], [1, 10]]), [[-1, -4], [-8, 4]])