public void FromColor(Bgra4444 source) { ushort packedSource = source.PackedValue; PackedValue = (ushort)( ((packedSource & Bgra4444.MaxXYZW) * 2) | ((((packedSource >> 4) & Bgra4444.MaxXYZW) * 4) << 5) | ((((packedSource >> 8) & Bgra4444.MaxXYZW) * 2) << 11)); }
public void FromColor(Bgra4444 source) { ushort packedSource = source.PackedValue; PackedValue = (ushort)( ((((packedSource >> 0) & Bgra4444.MaxXYZW) * 2) << 0) | ((((packedSource >> 4) & Bgra4444.MaxXYZW) * 2) << 5) | ((((packedSource >> 8) & Bgra4444.MaxXYZW) * 2) << 10) | ((int)((packedSource >> 12) / (float)Bgra4444.MaxXYZW + 0.5f) << 15)); }
public void FromColor(Bgra4444 source) => FromColor(source.ToRgba32());