// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // Description: // Cycles the background color of viewports, and then to gradient display // // Return Value: // None. // global proc cycleBackgroundColor(){ // query bg color float $rgb[3] = `displayRGBColor -query background`; int $gradOn = `displayPref -q -displayGradient`; if ($gradOn) { displayRGBColor background 0 0 0; displayPref -displayGradient 0; } else { if ($rgb[0] == 0) { displayRGBColor background 0.36 0.36 0.36;//default color } else if ($rgb[0] < 0.5) { displayRGBColor background 0.631 0.631 0.631; } else { displayPref -displayGradient 1; } } optionVar -intValue "displayViewportGradient" `displayPref -query -displayGradient`; }