def __init__(self, matrix, config): super(Art, self).__init__(matrix, self.generate, maxticks=20, interpolate=False) self.colormap = Colormap(130) self.colormap.flat(0, 130, BLACK) self.colormap.flat(20, 30, BLUE) self.colormap.flat(50, 60, YELLOW) self.colormap.flat(80, 90, RED) self.colormap.flat(110, 120, GREEN) self.colormap.soften() self.diamond.generate()
def __init__(self, matrix, config): self.width = matrix.width * SCALE self.height = matrix.height * SCALE self.matrix = OPCMatrix(self.width, self.height, None) self.diamond = DiamondSquareAlgorithm( self.matrix.width, self.matrix.height, (self.matrix.width + self.matrix.height) / 4) self.colormap = Colormap(palette=OrderedDict([ (rgb["NavyBlue"], 20), (rgb["blue"], 15), (rgb["yellow3"], 5), (rgb["LawnGreen"], 10), (rgb["ForestGreen"], 20), (rgb["gray50"], 15), (rgb["snow1"], 5), ])) self.diamond.generate() self.diamond.translate(self.matrix, colormap=self.colormap) self.matrix.blur() self.theta = 0 self.radius = 0