[comp.sys.mac.programmer] How do I dim the screen with software?

hughes@ux.acs.umn.edu (Steve Hughes) (05/09/91)

I'm trying to figure out how to dim my color screen from software,
like screen savers like "Dimmer" or the "FadeAway" module from 
After Dark do. Doesn't seem like it should be that hard, if they 
are able to change the screen brightness on the Classic with a
dinky little cdev, do they just change a memory location or what? Is
something this easy being done with Dimmer or FadeAway? How can
I do this? Any clues/code/page numbers in Inside Mac would be
much appreciated!

-Steve

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Steve Hughes
Pediatric Neuropsychology
University of Minnesota
hughes@ux.acs.umn.edu
612-644-0772
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

lemke@radius.com (Steve Lemke) (05/14/91)

hughes@ux.acs.umn.edu (Steve Hughes) writes:

}I'm trying to figure out how to dim my color screen from software,
}like screen savers like "Dimmer" or the "FadeAway" module from 
}After Dark do. Doesn't seem like it should be that hard, if they 
}are able to change the screen brightness on the Classic with a
}dinky little cdev, do they just change a memory location or what? Is
}something this easy being done with Dimmer or FadeAway? How can
}I do this? Any clues/code/page numbers in Inside Mac would be
}much appreciated!

This has been discussed here before, but unfortunately I did not save
the resulting suggestions/solutions.

Actually, the solution involves much more than simply changing a "brightness"
location somewhere in memory.  It involves writing and rewriting the CLUT
over and over, with successively lower (read "darker") brightness levels for
each CLUT entry.  Basically, I would guess that, if each time you rewrite the
CLUT, you start with the original, and subtract some constant from each value
of red, green, and blue, then the next time you make the constant a little
larger (subtract a little more), until all r,g,b values are zero, then you're
going to basically have a fade out routine (although maybe instead of subtract-
ing down to zero, you might have to successively add until each value is 255.
I can never keep it straight with all the inversions that go on between what
is black and what is white as far as the Mac goes and as far as the video board
goes...)


-- 
----- Steve Lemke, KC6QDT - Software Engineering, Radius Inc., San Jose -----
----- Reply to: lemke@radius.com -- U.C. Santa Barbara ECE Class of '89 -----
----- "I'm not a UNIX wizard, but I play the Postmaster at radius.com." -----