- void CreateMaskFromColor(const Color col, ubyte alpha) {
- const Color new_col = col.Modify(Color.Spectrum.Alpha, alpha);
- ubyte[4][] color_data;
- foreach (const Color pixel_col; this._colors) {
- /*
- if (pixel_col != col) {
- color_data ~= pixel_col.Export();
- } else {
- //pixel_col = new_col;
- color_data ~= new_col.Export();
- }
- */
- color_data ~= pixel_col.Export();
- }
- this.LoadFromPixels(color_data.ptr, this._width, this._height, this._deepth, this._format);
- }