public ColorMap(C64Palette palette, C64Color initialColor) { _palette = palette; for (var y = 0; y < Height; y++) { for (var x = 0; x < Width; x++) { Colors[x, y] = initialColor; } } }
private void panelColors_Paint(object sender, PaintEventArgs e) { if (DesignMode) { return; } var y = 0f; var palette = new C64Palette(); var index = 0; foreach (var color in palette) { using (var b = new SolidBrush(color)) e.Graphics.FillRectangle(b, 0, y, panelColors.Width, _colorHeight); if (index == (int)_currentColor) { e.Graphics.DrawRectangle(Pens.Black, 0, y + 0, panelColors.Width - 1, _colorHeight); e.Graphics.DrawRectangle(Pens.White, 1, y + 1, panelColors.Width - 3, _colorHeight - 2); e.Graphics.DrawRectangle(Pens.Black, 2, y + 2, panelColors.Width - 5, _colorHeight - 4); } y += _colorHeight; index++; } }
public PetsciiImage(C64Palette palette) { Foreground = new ColorMap(palette, C64Color.LightBlue); Content = new PetsciiMap(); }
static C64Sprite() { Palette = new C64Palette(); ExtraColor1Index = 2; ExtraColor2Index = 3; }