Data AcQuisition And Real-Time AnalysisScope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
Contact us about
The _Color_Tint macro is one of the Macro Examples and Mini-Apps included with Daqarta. It allows you to derive a lighter or darker version of an existing color.
On input, user variable QC is the color to be adjusted, and QS is the adjustment value. The lighter or darker result is returned in QC.
Typically, you would use the ColorNum macro to obtain QC for a specified display color, such as QC=ColorNum?c to get the color of the input or output channel specified previously via the Channel Select variable Ch.
QS is a signed integer that will be added separately to each of the Red, Green, and Blue color components of QC. Each will be automatically limited to the range 0-255.
If QS is positive, the overall color retains its same hue but becomes lighter ("tint"). If QS is negative, the color becomes darker ("shade").
As an example, the Pulse Meter Mini-App includes an option (by setting UD=0 instead of the default UD=1) to use Custom Meters with black text on colored backgrounds. The backgrounds are lighter versions of the colors used to draw the main display traces for each input or output channel. This allows you to see at a glance which meter goes with which channel. In this case, _Color_Tint is used with QS=160 to get the lighter tint values.
_Color_Tint Macro Listing:
;<Help=H491C QR=QC & hFF ;Isolate Red component QG=int(QC>>8) & hFF ;Green QB=int(QC>>16) & hFF ;Blue QR=QR+QS ;Adjust Red QR=lim(QR,0,255) ;Limit Red to 0-255 QG=QG+QS ;Adjust Green QG=lim(QG,0,255) ;Limit Green to 0-255 QB=QB+QS ;Adjust Blue QB=lim(QB,0,255) ;Limit Blue to 0-255 QC=QR + QG<<8 + QB<<16 ;Reassemble changed color
Questions? Comments? Contact us!We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2021 by Interstellar Research
All rights reserved