public PaletteMenu(int width, int height, SpriteModel spriteModel, PaletteModel paletteModel, Action brushChanged) : base(width, height) { this.spriteModel = spriteModel; this.mouse = new MouseWatch(); this.paletteModel = paletteModel; this.brushChanged = brushChanged; }
public HueBar(int width, int height, PaletteModel paletteModel, PickerModel model) : base(width, height) { this.paletteModel = paletteModel; this.colorPicker = model; bar = new Color[width]; for (int i = 0; i < width; i++) { bar[i] = Helper.HsvToRgb(i * 360d / width, 1.0, 1.0); } mouse = new MouseWatch(); }
public void UpdatePalettePoints(PaletteModel paletteModel) { var palette = paletteModel.paletteSet; palettePoints = new HashSet <Point>(); for (int x = 0; x < Width; x++) { for (int y = 0; y < Height; y++) { var c = colors[x, y]; var p = new Point(x, y); if (palette.Contains(c)) { palettePoints.Add(p); } } } }
public void UpdateBrushPoints(PaletteModel paletteModel) { foregroundPoint = null; backgroundPoint = null; for (int x = 0; x < Width; x++) { for (int y = 0; y < Height; y++) { var c = colors[x, y]; var p = new Point(x, y); if (model.brush.foreground == c) { foregroundPoint = p; } if (model.brush.background == c) { backgroundPoint = p; } } } }