From 89d943a90c0dd491588ab6e77dd862f930636cea Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 16 Aug 2021 20:01:41 +0100 Subject: [PATCH] Transfer custom colours from board stackup to 3D viewer. --- 3d-viewer/3d_canvas/board_adapter.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index 8eb4de0dff..75a0ba1ee0 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -550,10 +550,17 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR auto findColor = []( const wxString& aColorName, const CUSTOM_COLORS_LIST& aColorSet ) { - for( const CUSTOM_COLOR_ITEM& color : aColorSet ) + if( aColorName.StartsWith( "#" ) ) { - if( color.m_ColorName == aColorName ) - return color.m_Color; + return KIGFX::COLOR4D( wxColour( aColorName ) ); + } + else + { + for( const CUSTOM_COLOR_ITEM& color : aColorSet ) + { + if( color.m_ColorName == aColorName ) + return color.m_Color; + } } return KIGFX::COLOR4D();