Skip to content
Snippets Groups Projects
Commit 359dc891 authored by SAEZ Theo's avatar SAEZ Theo
Browse files

Ajout de la méthode invert à la classe ByteGrayColor pour inverser les niveaux de gris

parent ef904290
No related branches found
No related tags found
No related merge requests found
...@@ -40,12 +40,16 @@ public class ByteGrayColor implements GrayColor { ...@@ -40,12 +40,16 @@ public class ByteGrayColor implements GrayColor {
return new Color(component, component, component, OPACITY); return new Color(component, component, component, OPACITY);
} }
@Override @Override
public int compareTo(GrayColor o) { public int compareTo(GrayColor o) {
return Double.compare(this.getLuminosity(), o.getLuminosity()); return Double.compare(this.getLuminosity(), o.getLuminosity());
} }
@Override
public GrayColor invert() {
return new ByteGrayColor(MAXIMUM_GRAY_LEVEL - this.grayLevel);
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment