public NBitColors(int bitsPerChannel)
    {
        this.bitsPerChannel = bitsPerChannel;
        this.channelMask = (1 << bitsPerChannel) - 1;
        this.additionalShift = 8 - bitsPerChannel;
        this.maxVal = (1 << (3 * bitsPerChannel)) - 1;
    }