Note that there are some explanatory texts on larger screens.

plurals
  1. POCompare color shades?
    primarykey
    data
    text
    <p>I have two colors, how do I check if they are the same color but just a different shade? I've been trying but I cant seem to figure it out, I really don't know what I'm doing lol... This is what I have so far: </p> <pre><code>import java.awt.Color; public class Sandbox { public Sandbox() { Color c = new Color(5349322); int r, g, b; r = c.getBlue(); g = c.getGreen(); b = c.getRed(); System.out.println("Red: " + r); System.out.println("Green: " + g); System.out.println("Blue: " + b); } private boolean FindColorTol(int intTargetColor, int Tolerance) { Color targetColor = new Color(intTargetColor); Color imgColor = new Color(5349322); int targetRED = targetColor.getBlue(), targetGREEN = targetColor.getGreen(), targetBLUE = targetColor.getRed(), imgRED = imgColor.getBlue(), imgGREEN = imgColor.getGreen(), imgBLUE = imgColor.getRed(); return false; } private int getLargest(int...values) { int largest = 0; for(int i = 0; i &lt; values.length; i++) { if(values.length &gt; i + 1) { if(values[i] &gt; values[i + 1]) largest = values[i]; else largest = values[i + 1]; } } return largest; } public static void main(String[] args) { new Sandbox(); } } </code></pre> <p>And also, why does Color.getRed(), return the value for blue and, Color.getBlue() returns the value for returns the value for red? I am using this to find RGB values: <a href="http://www.colorschemer.com/online.html" rel="nofollow">http://www.colorschemer.com/online.html</a></p> <p><strong>I am trying to use this to find a specified color within an image.</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload