How to set gradient 2 colors background

Hi @john12,

From a command you can do something like this:

CRhinoCommand::result CCommandTest::RunCommand(const CRhinoCommandContext& context)
{
  const ON_UUID display_mode = ON_StandardDisplayModeId::Rendered;
  DisplayAttrsMgrListDesc* pDisplayAttrs = CRhinoDisplayAttrsMgr::FindDisplayAttrsDesc(display_mode);
  if (nullptr != pDisplayAttrs)
  {
    CDisplayPipelineAttributes* pAttrs = pDisplayAttrs->m_pAttrs;
    if (nullptr != pAttrs)
    {
      pAttrs->m_eFillMode = EFrameBufferFillMode::FBFM_GRADIENT_2_COLOR;
      pAttrs->m_GradTopLeft = RGB(0, 50, 102);
      pAttrs->m_GradBotLeft = RGB(165, 165, 165);
      pAttrs->m_GradTopRight = pAttrs->m_GradTopLeft;
      pAttrs->m_GradBotRight = pAttrs->m_GradBotLeft;
      CRhinoDisplayAttrsMgr::UpdateAttributes(*pDisplayAttrs);
      CRhinoDisplayAttrsMgr::SaveProfile(RhinoApp().ProfileContext());
      context.m_doc.Regen();
    }
  }
  return CRhinoCommand::success;
}

– Dale