I've just read the new post at Medium about Sentinel-2 color correction with Sentinel Playground. It says that
The default gain factor is set to 2.5, which corresponds to white-point reflectance of 40% (a pixel with 40% or more reflectance in all three bands will appear white in the resulting image).
I get very similar visual result by stretching contrast in QGIS [0, 4095] --> [0, 255] for each band. I've chosen these ranges based on histogram and radiometric resolution of 12 bits. Please, help me understand what operations are performed with the image when setting gain factor at Sentinel Playground?