package xyz.marsavic.gfxlab.playground.colorfunctions;

import xyz.marsavic.geometry.Vector;
import xyz.marsavic.gfxlab.Color;
import xyz.marsavic.gfxlab.ColorFunctionT;

public class BoringGrid implements ColorFunctionT {
    @Override
    public Color at(double t, Vector p) {
        double linew = 0.01;
        double gridw = 0.2;
        return Color.gray((p.x() - linew/2)/gridw <= Math.floor((p.x() + linew/2)/gridw) ||
                (p.y() - linew/2)/gridw <= Math.floor((p.y() + linew/2)/gridw) ?
                0.9 : 0.05);
    }
}
