static IFastImage Visualize(CellBoard board, bool showOnlyLargestArea, int scale = 1) { if (showOnlyLargestArea) { var(area, size) = ConnectedAreaAnalyzer .FindForegroundAreas(board.Dimensions, p => board[p] == CellType.Dead) .MaxBy(component => component.Area) ?.TrimExcess(1) ?? throw new InvalidOperationException("This can't happen"); return(GenericVisualizer.RenderBinary(size, isTrue: area.Contains, trueColor: SKColors.White, falseColor: SKColors.Black, scale: scale)); } else { return(GenericVisualizer.RenderBinary(board.Dimensions, isTrue: p => board[p] == CellType.Dead, trueColor: SKColors.White, falseColor: SKColors.Black, scale: scale)); } }
public void HslColor() { using var img = GenericVisualizer.RenderPalette( new Size(10, 10), pos => SKColor.FromHsl(0, 100 * (pos.X / 10f), 100 * (pos.Y / 10f)), scale: 20); Save(img, "HSL with Saturation x Luminosity"); }
static IFastImage Visualize(CellBoard board, int scale = 1) => GenericVisualizer.RenderBinary(board.Dimensions, isTrue: p => board[p] == CellType.Dead, trueColor: SKColors.White, falseColor: SKColors.Black, scale: scale);