Output colors don't match FColor

I’m trying to figure out why the color I write for the texture of my UImage doesn’t match what I specify in my FColor. For the sake of this post, I simplified the code but the result is the same:

    TArray<uint8> textureBuffer;
    textureBuffer.Init(0, 128 * 128 * 4);

    auto pixelIndex = 0;
    for (auto Y = 0; Y < 128; ++Y)
    {
        for (auto X = 0; X < 128; ++X)
        {
            textureBuffer[pixelIndex++] = 33;
            textureBuffer[pixelIndex++] = 66;
            textureBuffer[pixelIndex++] = 99;
            textureBuffer[pixelIndex++] = 255;
        }
    }

    auto updateTextureRegion = new FUpdateTextureRegion2D(0, 0, 0, 0, 128, 128);
    const auto BufferPitch = 128 * 4;
    _texture->UpdateTextureRegions(0, 1, updateTextureRegion, BufferPitch, 4, 
    textureBuffer.GetData(), &FreeUpdateMemory);

Basically, I create an array of RGB(99, 66, 33). I then dump the array using _imageWidget->SetBrushFromTexture(_texture). When I look at the result, the pixels seem much brighter. This is confirmed using a drawing software.

331801-pixelswrongcolor.jpg

I tried playing with the Image widget settings such as Tint and ColorAndOpacity, but no luck. Couldn’t find anything on the web/forums either.

Not sure, but you can try to set Gamma to 2.2 as it is often done with SceneCapture2DTarget.

The comment provided by @Kehel18 made me search about how to adjust Gamma. I discovered that my UTexture2D was created with SRGB = 0 (blindly copied from the web). I commented out this line (leave default of 1) and colors now perfectly match. Thanks Kehel!