Custom Editor Window Mistakenly Brightened

Good day! I have a custom editor window that is exhibiting a strange issue with it’s color.

Basically, all of the windows, buttons, and fields appear lighter than they should.

You’ll notice in the picture below how the regular inspector looks in Dark Theme. The window to the left is my custom one; it’s somewhat atypical in that I am using PreviewRenderUtility to cover the entire window with a “scene like” view, then the GUI controls are drawn over the preview. All buttons, fields, and most other elements are not using custom GUIStyle’s, so they should appear exactly like the default inspector. The GUI control windows are using an image that I had to make significantly darker than it “should” have needed to be, in order to get the color to match the default inspector color.

Anyone have any ideas on what could be going on? The preview is drawn with these two lines of code (the lines aren’t one after the other like they are here):
preview.BeginPreview(pos, GUIStyle.none);
preview.Render(true, false);

I created a test editor window and it did not exhibit the issue, so I am inclined to believe the issue is why my use of PreviewRenderUtility.

You can most easily see the issue on the two buttons under “View Controls” which on the right side of my custom editor window. To the right of those buttons you can see what the buttons should look like by looking at the “Edit Repository” button in the inspector.

Maybe edit / preferences / colors?

Thank you for taking the time to reply! Unfortunately, the preferences don’t seem to have an effect on this issue.

Bump

No one?

Well, I tracked down the cause. The issue is caused by a switch to the Linear color space. Swithing the color space back to gamma is not feasible, because this editor is for an Asset Store tool where I must be able to support both gamma and linear space.

This only became an issue because I had my editor stuff being drawn before PreviewRenderUtiliyt.EndAndDrawPreview was called. It seemed doing this caused the editor stuff to be affected by the color space rather than ignoring the color space as normal Unity editor code does.