WIP
DirectOutput framework for virtual pinball cabinets WIP
Go to:
Overview 
RGBAMatrixColorEffect.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
7 
8 namespace DirectOutput.FX.MatrixFX
9 {
13  public class RGBAMatrixColorEffect : MatrixValueEffectBase<RGBAColor>
14  {
15 
16  private RGBAColor _ActiveColor = new RGBAColor(0xff, 0xff, 0xff, 0xff);
17 
25  public RGBAColor ActiveColor
26  {
27  get { return _ActiveColor; }
28  set { _ActiveColor = value; }
29  }
30 
31  private RGBAColor _InactiveColor = new RGBAColor(0, 0, 0, 0);
32 
40  public RGBAColor InactiveColor
41  {
42  get { return _InactiveColor; }
43  set { _InactiveColor = value; }
44  }
45 
46 
52  protected override RGBAColor GetEffectValue(int TriggerValue)
53  {
54  RGBAColor D=new RGBAColor();
55 
56  int V = TriggerValue.Limit(0, 255);
57  D.Red = InactiveColor.Red + (int)((float)(ActiveColor.Red - InactiveColor.Red) * V / 255).Limit(0, 255);
58  D.Green = InactiveColor.Green + (int)((float)(ActiveColor.Green - InactiveColor.Green) * V / 255).Limit(0, 255);
59  D.Blue = InactiveColor.Blue + (int)((float)(ActiveColor.Blue - InactiveColor.Blue) * V / 255).Limit(0, 255);
60  D.Alpha = InactiveColor.Alpha + (int)((float)(ActiveColor.Alpha - InactiveColor.Alpha) * V / 255).Limit(0, 255);
61  return D;
62  }
63  }
64 }
This class stores information on colors used for toys and effects (e.g. RGBLed).
Definition: RGBAColor.cs:14
The namespace DirectOutput.Cab.Toys contains all toy related classes.
Sets the spefied area of matrix to the specified colors depending on the trigger value.
override RGBAColor GetEffectValue(int TriggerValue)
Gets the effect color by mixinging Active and InactiveColor based on the TriggerValue.
int Red
Brightness for Red.
Definition: RGBAColor.cs:27
Base class for effects setting all elements a specified area of a matrix toy to the same specific val...
int Green
Brightness for Green.
Definition: RGBAColor.cs:40
The namespace DirectOutput.Cab contains all cabinet related classes like the Cabinet class itself...
Definition: Cab.cs:16
int Blue
Brightness for Blue.
Definition: RGBAColor.cs:52
int Alpha
Alpha value for the color.
Definition: RGBAColor.cs:64
Namespace for objects dealing with layers
The namespace DirectOutput.General contains classes for general use.