mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
33 lines
599 B
C#
33 lines
599 B
C#
|
#region === Copyright (c) 2010 Pascal van der Heiden ===
|
||
|
|
||
|
using System.Drawing;
|
||
|
|
||
|
#endregion
|
||
|
|
||
|
namespace CodeImp.DoomBuilder.Plugins.VisplaneExplorer
|
||
|
{
|
||
|
internal class Palette
|
||
|
{
|
||
|
// Members
|
||
|
private readonly int[] colors;
|
||
|
|
||
|
// Properties
|
||
|
public int[] Colors { get { return colors; } }
|
||
|
|
||
|
// Constructor
|
||
|
public Palette(Bitmap bmp)
|
||
|
{
|
||
|
// Initialize
|
||
|
colors = new int[bmp.Size.Width];
|
||
|
for(int x = 0; x < bmp.Size.Width; x++)
|
||
|
colors[x] = bmp.GetPixel(x, 0).ToArgb();
|
||
|
}
|
||
|
|
||
|
// This overrides a color
|
||
|
public void SetColor(int index, int color)
|
||
|
{
|
||
|
colors[index] = color;
|
||
|
}
|
||
|
}
|
||
|
}
|