How to Judge if a Color is Green?
问题 What is the formula for deciding if an rgb code is green? Here is an attempt: public boolean isGreen(Color color){ return (color.getGreen() > 0.8*(color.getBlue()) && color.getBlue() > color.getRed()); } That is, return true if the green value of rgb is considerably greater than the blue, and the blue is greater than the red. A test was conducted on its accuracy. Methods: A JavaFX program generated 132 orbs every 6 seconds, each with an rgba (alpha is irrelevant in this case) value of (Math