Error message: "agcolor unable to access colors. Is X running and DISPLAY set?"

Problem: I have installed a software that does not start or when it does crashes fairly quickly giving the error message “agcolor unable to access colors. Is X running and DISPLAY set?”
I am relatively an inexperienced Linux user. I know you will ask for some details regarding the system , I try to provide a hint below but please guide me on what you might need.
I found a 2012 answer: Does it help at all to change the display colour depth to something different - e.g. if you’re currently using 32 bit colour depth, did you try 16 or 24?
But I won’t change the color depth of Linux systems

What is agcolor? I can’t find such thing from base nor EPEL.

Is X running and DISPLAY set?

X Window System, X11, is windowing system. When you have graphical session on Rocky,
the windows are drawn by Xorg (X11 server), or by Wayland. Wayland is not X11, but has XWayland (X11 server). If you have GUI session, then you should have X11 server.

The X11 client applications connect to X11 server with identifier that is stored in environment variable DISPLAY. For example:

$ echo $DISPLAY
:0

That is, when I start X11 client program, it will connect to localhost:0 (where the X11 server listens).

If you have only a console session, then DISPLAY is not set. (One can actually tunnel X via ssh, etc, but that is an another story.)

How to change the color depth of the redhat system.I need is 8bit color depth.But I don’t know how to modify the display

How to change the color depth of the redhat system.I need is 8bit color depth.But I don’t know how to modify the display