boxcollider color

how to change color in preferences for boxcollider?

You can’t but what you can do, is collapse the box collider component, (change foldout from V to >)
And then render your own gizmo in OnDrawGizmos().

Collapsing the foldout on the inspector will prevent it rendering it’s own green box, enabling you to render your own. It’s not ideal. But that’s all I can offer as advice.