diff --git a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp index 03683fd1f..7a257e2bb 100644 --- a/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D11PipelineStateViewer.cpp @@ -2118,7 +2118,8 @@ void D3D11PipelineStateViewer::highlightIABind(int slot) const D3D11Pipe::IA &IA = m_Ctx.CurD3D11PipelineState().m_IA; - QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f); + QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, + qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); ui->iaLayouts->beginUpdate(); ui->iaBuffers->beginUpdate(); @@ -2128,7 +2129,7 @@ void D3D11PipelineStateViewer::highlightIABind(int slot) RDTreeWidgetItem *item = m_VBNodes[(int)slot]; item->setBackgroundColor(col); - item->setForegroundColor(QColor(0, 0, 0)); + item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } for(int i = 0; i < ui->iaLayouts->topLevelItemCount(); i++) @@ -2143,7 +2144,7 @@ void D3D11PipelineStateViewer::highlightIABind(int slot) else { item->setBackgroundColor(col); - item->setForegroundColor(QColor(0, 0, 0)); + item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } } diff --git a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp index 33600b5b8..804a20028 100644 --- a/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp @@ -2020,7 +2020,8 @@ void D3D12PipelineStateViewer::highlightIABind(int slot) const D3D12Pipe::IA &IA = m_Ctx.CurD3D12PipelineState().m_IA; - QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f); + QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, + qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); ui->iaLayouts->beginUpdate(); ui->iaBuffers->beginUpdate(); @@ -2028,7 +2029,7 @@ void D3D12PipelineStateViewer::highlightIABind(int slot) if(slot < m_VBNodes.count()) { m_VBNodes[slot]->setBackgroundColor(col); - m_VBNodes[slot]->setForegroundColor(QColor(0, 0, 0)); + m_VBNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } for(int i = 0; i < ui->iaLayouts->topLevelItemCount(); i++) @@ -2043,7 +2044,7 @@ void D3D12PipelineStateViewer::highlightIABind(int slot) else { item->setBackgroundColor(col); - item->setForegroundColor(QColor(0, 0, 0)); + item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } } diff --git a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp index 6f573936f..735564c2d 100644 --- a/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/GLPipelineStateViewer.cpp @@ -2149,7 +2149,8 @@ void GLPipelineStateViewer::highlightIABind(int slot) const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState().m_VtxIn; - QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f); + QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, + qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); ui->viAttrs->beginUpdate(); ui->viBuffers->beginUpdate(); @@ -2157,7 +2158,7 @@ void GLPipelineStateViewer::highlightIABind(int slot) if(slot < m_VBNodes.count()) { m_VBNodes[slot]->setBackgroundColor(col); - m_VBNodes[slot]->setForegroundColor(QColor(0, 0, 0)); + m_VBNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } for(int i = 0; i < ui->viAttrs->topLevelItemCount(); i++) @@ -2172,7 +2173,7 @@ void GLPipelineStateViewer::highlightIABind(int slot) else { item->setBackgroundColor(col); - item->setForegroundColor(QColor(0, 0, 0)); + item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } } diff --git a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp index 7e94193f2..54404cd06 100644 --- a/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp +++ b/qrenderdoc/Windows/PipelineState/VulkanPipelineStateViewer.cpp @@ -2163,7 +2163,8 @@ void VulkanPipelineStateViewer::highlightIABind(int slot) const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState().VI; - QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f); + QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, + qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95)); ui->viAttrs->beginUpdate(); ui->viBuffers->beginUpdate(); @@ -2171,13 +2172,13 @@ void VulkanPipelineStateViewer::highlightIABind(int slot) if(slot < m_VBNodes.count()) { m_VBNodes[slot]->setBackgroundColor(col); - m_VBNodes[slot]->setForegroundColor(QColor(0, 0, 0)); + m_VBNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } if(slot < m_BindNodes.count()) { m_BindNodes[slot]->setBackgroundColor(col); - m_BindNodes[slot]->setForegroundColor(QColor(0, 0, 0)); + m_BindNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } for(int i = 0; i < ui->viAttrs->topLevelItemCount(); i++) @@ -2192,7 +2193,7 @@ void VulkanPipelineStateViewer::highlightIABind(int slot) else { item->setBackgroundColor(col); - item->setForegroundColor(QColor(0, 0, 0)); + item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0))); } }