Skip to content
Snippets Groups Projects
Select Git revision
  • b4f3f557e9ca985f5f2d113720499ab3b534ef1f
  • main default protected
  • variant
3 results

Grid.java

Blame
  • Forked from LABOUREL Arnaud / Firefighter template
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ByteGrayColor.java 1.41 KiB
    import javafx.scene.paint.Color;
    
    /**
     * Created by Arnaud Labourel on 02/10/2018.
     */
    
    public class ByteGrayColor implements GrayColor {
    
        private static final int MINIMUM_GRAY_LEVEL = 0;
        private static final int MAXIMUM_GRAY_LEVEL = 255;
        private static final int OPACITY = 1;
    
        private final int grayLevel;
    
    
        public ByteGrayColor(){
           this.grayLevel = MINIMUM_GRAY_LEVEL;
        }
    
        public ByteGrayColor(int grayLevel) {
            // TODO : Corriger l'initialisation de la propriété grayLevel de l'instance.
            this.grayLevel = 0;
        }
    
        public ByteGrayColor(double luminosity) {
            // TODO : Corriger l'initialisation de la propriété grayLevel de l'instance.
            this.grayLevel = 0;
        }
    
        @Override
        public double getLuminosity() {
            // TODO : Retourner la luminosité de la couleur (entre 0 noir et 1 blanc)
            return 0;
        }
    
        @Override
        public Color getColor(){
            double component = getLuminosity();
            return new Color(component, component, component, OPACITY);
        }
    
    
        @Override
        public int compareTo(GrayColor o) {
            // TODO : Retourner la différence de niveau de gris.
            return 0;
        }
    
        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (this.getClass() != o.getClass()) return false;
            ByteGrayColor color = (ByteGrayColor) o;
            return this.compareTo(color) == 0;
        }
    
    }