Hi!
I am trying to draw some text over a drawn texture in the scene view. I generate a texture with a given color, which I draw in the Scene View using GUI.DrawTexture. I then render text on screen using GUI.Label, for which I create a GUIStyle for which I set its normal.textColor to that same color. Yet these colors do not match visually.
It seems that the textcolor has some offset which causes the color to shift a little.
This is the code I use to do this:
//Calculate 2d position on screen from 3d position
float sceneViewControlBarHeight = 21f;
Vector2 screenPosition = SceneView.currentDrawingSceneView.camera.WorldToScreenPoint(_component.transform.position);
Vector2 invertedScreenPosition = new Vector2(screenPosition.x, (-screenPosition.y + SceneView.lastActiveSceneView.position.height - sceneViewControlBarHeight));
//Create GUIStyle
GUIStyle style = new GUIStyle(GUI.skin.label);
style.normal.textColor = _component.TextColor;
style.fontSize = 48;
//Create image Rect
Rect imageRect = new Rect(invertedScreenPosition.x, invertedScreenPosition.y, 265, 90);
//Draw background, border, icon and label
Handles.BeginGUI();
GUI.DrawTexture(imageRect, _component.BackgroundTexture, ScaleMode.StretchToFill, true, 0f, _component.BackgroundColor, 0f, 30);
GUI.DrawTexture(imageRect, _component.BorderTexture, ScaleMode.StretchToFill, true, 0f, _component.TextColor, 10, 30);
GUI.Label(imageRect, "Some Label", style);
Handles.EndGUI();
And here is what it looks like:


Although this effect does not show equally for all colors, as seen here:

Can somebody tell me why this effect occurs, and how I might be able to fix it?
Thank you!