Export Color name instead of of Hex code #10861

Closed
opened 2025-12-29 21:36:52 +01:00 by adam · 8 comments
Owner

Originally created by @dfex on GitHub (Mar 7, 2025).

Originally assigned to: @Jathn on GitHub.

NetBox version

v4.2.5-Docker-3.2.0

Feature type

Change to existing functionality

Proposed functionality

Hello Netbox legends!

I'm exporting the Cables view to CSV for my field techs to go and patch interfaces.

One thing that confuses them (among many) is that Netbox exports the Colour column as Hex Values:
Image

It would be great if this could export the Color name (that is displayed in the color picker drop-down) instead:
Image

Thanks!

Ben

Use case

Would allow netbox admins to export Cable views as patching schedules for electrical/cabling contractors to execute.

Database changes

Possibly, yes - from what I can see of the API data, only the hex code is stored, not the color name

External dependencies

None

Originally created by @dfex on GitHub (Mar 7, 2025). Originally assigned to: @Jathn on GitHub. ### NetBox version v4.2.5-Docker-3.2.0 ### Feature type Change to existing functionality ### Proposed functionality Hello Netbox legends! I'm exporting the Cables view to CSV for my field techs to go and patch interfaces. One thing that confuses them (among many) is that Netbox exports the Colour column as Hex Values: ![Image](https://github.com/user-attachments/assets/ed8b1b76-99b7-423b-9839-40e1d842fb85) It would be great if this could export the Color name (that is displayed in the color picker drop-down) instead: ![Image](https://github.com/user-attachments/assets/d31f02b8-6044-4739-9479-f1d698f2cc23) Thanks! Ben ### Use case Would allow netbox admins to export Cable views as patching schedules for electrical/cabling contractors to execute. ### Database changes Possibly, yes - from what I can see of the API data, only the hex code is stored, not the color name ### External dependencies None
adam added the status: acceptedtype: featurecomplexity: low labels 2025-12-29 21:36:52 +01:00
adam closed this issue 2025-12-29 21:36:53 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 13, 2025):

Storing the actual RGB value in the database has some utility, so I think we want to keep it. However, we could add an optional field on the tables with color fields to include the name of the color as well.

We could potentially also support using the color names for bulk import as well, by introducing an optional color_name field. That should probably be a separate FR though.

@jeremystretch commented on GitHub (Mar 13, 2025): Storing the actual RGB value in the database has some utility, so I think we want to keep it. However, we could add an optional field on the tables with color fields to include the name of the color as well. We could potentially also support using the color names for bulk import as well, by introducing an optional `color_name` field. That should probably be a separate FR though.
Author
Owner

@dfex commented on GitHub (Mar 15, 2025):

I'm happy to own this one and get a PR raised

@dfex commented on GitHub (Mar 15, 2025): I'm happy to own this one and get a PR raised
Author
Owner

@1024834 commented on GitHub (Mar 18, 2025):

We could potentially also support using the color names for bulk import as well, by introducing an optional color_name field. That should probably be a separate FR though.

Requested in #18936

@1024834 commented on GitHub (Mar 18, 2025): > We could potentially also support using the color names for bulk import as well, by introducing an optional `color_name` field. That should probably be a separate FR though. Requested in #18936
Author
Owner

@bctiemann commented on GitHub (Mar 18, 2025):

@dfex if you can handle https://github.com/netbox-community/netbox/issues/18936 as well, please comment in that FR and we can assign it to you. Thanks!

@bctiemann commented on GitHub (Mar 18, 2025): @dfex if you can handle https://github.com/netbox-community/netbox/issues/18936 as well, please comment in that FR and we can assign it to you. Thanks!
Author
Owner

@jnovinger commented on GitHub (May 14, 2025):

@dfex is this still in progress?

@jnovinger commented on GitHub (May 14, 2025): @dfex is this still in progress?
Author
Owner

@dfex commented on GitHub (May 15, 2025):

Sorry, haven't made much progress on this issue to date. Feel free to remove it from me and re-assign.

@dfex commented on GitHub (May 15, 2025): Sorry, haven't made much progress on this issue to date. Feel free to remove it from me and re-assign.
Author
Owner

@Jathn commented on GitHub (Jul 29, 2025):

Hello. I recently closed issue #18936. The solution I made was matching the color names against those in ColorChoices and then resorting to the base case. I did not see this issue at the time, but have a proposed solution on how to go forward.

My suggestion for implementing the export functionality would be to reverse it:
Add a property color_name to cable that is derived from ColorChoices using the stored hex value (color.)

An example export template could then reference this as:

{{ cable.color_name }}

I'll gladly implement it as well.

@Jathn commented on GitHub (Jul 29, 2025): Hello. I recently closed issue #18936. The solution I made was matching the color names against those in ColorChoices and then resorting to the base case. I did not see this issue at the time, but have a proposed solution on how to go forward. My suggestion for implementing the export functionality would be to reverse it: Add a property *color_name* to _cable_ that is derived from _ColorChoices_ using the stored hex value (_color_.) An example export template could then reference this as: ```{jinja} {{ cable.color_name }} ``` I'll gladly implement it as well.
Author
Owner

@jeremystretch commented on GitHub (Jul 29, 2025):

All yours @Jathn, thanks!

@jeremystretch commented on GitHub (Jul 29, 2025): All yours @Jathn, thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10861