Page MenuHome

UI Themes: Grid color affecting axis color
Confirmed, NormalPublicDESIGN


Blender Version
2.81a, 2.82 Beta.

In 3D View, the grid color overlays the XYZ axis colors, so it's impossible to set the colors I want to the XYZ axis.
This even happens if the grid color is set to transparent.

Exact steps for others to reproduce the error

  • Go to preferences -> Themes -> User Interface -> Axis & Gizmo Colors
  • Change X and Y axis color to black RGB(0, 0, 0)
  • Go to preferences -> Themes -> 3d View
  • change Grid color/alpha.

X and Y axis color will be affected

Event Timeline

Find the settings to change axis and gizmo colors in Preferences → Themes → User interface → Axis and Gizmo Colours.

Ankit, I know how to choose the axis color. The problem is that the color we pick for the Axis is then mixed with the grid color in the viewport. So the axis colors are brighter or darker depending on the grid color, and always less saturated. For example, if you need to set X axis to be the color red (R 255 G 0 B 0) the viewport will show a different less saturated red because it is mixing it with the grid color, so if I change the grid color to match the desired red for the axis, the other 2 axis colors will be screwed up. The grid is influencing XYZ colors even if the grid is fully transparent. The XYZ axis colors should be totally independent from the grid color.

I can confirm this. For an easy to see example set the x-axis to red (1 0 0) and the grid to blue (0 0 1). The x-axis will show as a magenta line.

Ankit Meel (ankitm) added a comment.EditedJan 25 2020, 6:23 PM

It was not clear to me by the original task description. I suggest you edit it.
Also, not that I know the code, but the axes are grid first, and then three special lines were taken to be given a different color. So linkage between grid and axis settings could be there.

Even setting the grid colour (RGBA) to 0,0,0,0 will only get you close to the axis colour. I can't get a pure red axis to show up on screen. Perhaps there's some other colour management stuff going on there.

Richard Antalik (ISS) renamed this task from 3d viewport XYZ axis colors are incorrect. to UI Themes: Grid color affecting axis color.Jan 25 2020, 8:18 PM
Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.
Richard Antalik (ISS) updated the task description. (Show Details)

I've recently checked on this briefly to see where the issue is coming from, but I didn't see anything suspicious. My first guess was that the grid overlaps the axes, so that you'd get the color mixed. But even disabling the grid didn't seem to fix this.

@Jeroen Bakker (jbakker), could you have a look at this?

Julian Eisel (Severin) changed the subtype of this task from "Report" to "Bug".Feb 18 2020, 6:44 PM

Classifying this as bug for now, because the code doesn't seem to do this intentionally from what I can see. The viewport team can re-classify if they disagree.

Clément Foucault (fclem) changed the subtype of this task from "Bug" to "Design".Apr 17 2020, 9:27 PM

This seems to be on purpose. draw_common.c : l.173 :

/* Grid Axis */
UI_GetThemeColorBlendShade4fv(TH_GRID, TH_AXIS_X, 0.5f, -10, gb->colorGridAxisX);
UI_GetThemeColorBlendShade4fv(TH_GRID, TH_AXIS_Y, 0.5f, -10, gb->colorGridAxisY);
UI_GetThemeColorBlendShade4fv(TH_GRID, TH_AXIS_Z, 0.5f, -10, gb->colorGridAxisZ);

To me this is to avoid too much contrast in the grid but this could be a theme setting. I don't remember if there was any discussion about this.
CC: @William Reynish (billreynish)

I agree this seems like a bug - at the very least it’s quite unexpected.

There might be some "gotchas" in fixing this.

We can easily make it so the axes are drawn with in the exact theme colors chosen:

/* Grid Axis */
UI_GetThemeColor4fv(TH_AXIS_X, gb->colorGridAxisX);
UI_GetThemeColor4fv(TH_AXIS_Y, gb->colorGridAxisY);
UI_GetThemeColor4fv(TH_AXIS_Z, gb->colorGridAxisZ);

Then set the default colors to how they visually work out to now:

At that point the default lines look as they do now, but you can set them to anything you like and you see exactly that.

However, the Navigate gizmo balls look washed out since they share the same colors. We are used to those nav balls looking more saturated than the axes lines:

Then the gizmo colors should be chosen separately.

Yeah i already reported the bug almost two months ago