公式参考 https://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#cvtcolor 代码参考 RGB -> HSV function rgbToHsv([R, G, B, A]) { R /= 255 G /= 255 B /= 255 const max = Math.max(R, G, B) const min = Math.min(R