QRCoder icon indicating copy to clipboard operation
QRCoder copied to clipboard

Replace byte[] with color struct

Open Shane32 opened this issue 2 months ago • 0 comments

Instead of the byte[] could we use a

public struct Color
{
    public byte R;
    public byte G;
    public byte B;
    public byte A;
}

to avoid the (temp.) allocation?

Or when the array-like semantics should be kept, an InlineArray (where supported) / a fixed sized buffer when not supported?

Could be done in a separate PR also. Maybe that would be event better, as such "helper types" can be created there, and with a pass over the code base more such occurances be changed.

Originally posted by @gfoidl in https://github.com/Shane32/QRCoder/pull/640#discussion_r2405629452

Shane32 avatar Oct 06 '25 14:10 Shane32