SolidBackground.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System;
  2. using System.Drawing;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace ConsoleApplication
  8. {
  9. public class SolidBackground
  10. {
  11. private string _bgColor, _backgroundType, _fillType;
  12. private int _alpha, _tint, _luminanceMod, _saturationMod;
  13. private Color _color;
  14. public SolidBackground()
  15. {
  16. _bgColor = "ffffff";
  17. _alpha = 0;
  18. _fillType = "solid";
  19. _backgroundType = "linear";
  20. _color = new Color();
  21. }
  22. public string BgColor
  23. {
  24. get { return _bgColor; }
  25. set
  26. {
  27. _bgColor = value;
  28. _color = ColorTranslator.FromHtml("#"+_bgColor);
  29. }
  30. }
  31. public int Alpha
  32. {
  33. get { return _alpha; }
  34. set { _alpha = value; }
  35. }
  36. public string BackgroundType
  37. {
  38. get { return _backgroundType; }
  39. set { _backgroundType = value; }
  40. }
  41. public int SaturationMod
  42. {
  43. get { return _saturationMod; }
  44. set { _saturationMod = value; }
  45. }
  46. public int LuminanceMod
  47. {
  48. get { return _luminanceMod; }
  49. set { _luminanceMod = value; }
  50. }
  51. public int Tint
  52. {
  53. get { return _tint; }
  54. set { _tint = value; }
  55. }
  56. public Color Color
  57. {
  58. get { return _color; }
  59. set { _color = value; }
  60. }
  61. public string FillType
  62. {
  63. get{ return _fillType; }
  64. set { _fillType = value; }
  65. }
  66. public string toString()
  67. {
  68. return "BackgroundColor: " + _bgColor + "\nAlpha: " + _alpha + "\nType: " + _backgroundType +
  69. "\nTint: " + _tint + "\nLumMod: " + _luminanceMod + "\nSatMod: " + _saturationMod + "\n";
  70. }
  71. }
  72. }