diff --git a/Sources/MandelbrotEngine/ColourMaps/ColourMapProtocol.swift b/Sources/MandelbrotEngine/ColourMaps/ColourMapProtocol.swift index 0622ffc..a678d73 100644 --- a/Sources/MandelbrotEngine/ColourMaps/ColourMapProtocol.swift +++ b/Sources/MandelbrotEngine/ColourMaps/ColourMapProtocol.swift @@ -16,6 +16,7 @@ public protocol ColourMapProtocol { var title: String { get } var blackPixel: Pixel { get } var pixels: [Pixel] { get } + var preview: [Pixel] { get } func pixel(from test: MandelbrotSetPoint.Test) -> Pixel } @@ -23,6 +24,16 @@ public protocol ColourMapProtocol { extension ColourMapProtocol { public var id: String { title } + + public var preview: [Pixel] { + let count = pixels.count + var output: [Pixel] = [] + for _ in 0.. Pixel { switch test {