Esempio n. 1
0
 public Note(Color gBGColor, Color gFontColor, Font f, int opaq, String[] tbText)
 {
     InitializeComponent();
     this.tSettings = new ThemeSettings(false);
     this.tSettings.Hide();
     this.tSettings.setColor += new setColorHandler(setColor);
     this.tSettings.setOpacity += new setOpaqHandler(setOpaque);
     this.tSettings.setFont += new setFontHandler(setFont);
     this.close.MouseEnter += new EventHandler(close_MouseEnter);
     this.close.MouseLeave += new EventHandler(close_MouseLeave);
     this.close.MouseClick += new MouseEventHandler(onMouseClick);
     this.textBox.MouseClick += new MouseEventHandler(onMouseClick);
     this.titleLabel.MouseDoubleClick += new MouseEventHandler(title_MouseDoubleClick);
     this.titleLabel.MouseUp += new MouseEventHandler(title_MouseUp);
     this.titleLabel.MouseDown += new MouseEventHandler(title_MouseDown);
     this.titleLabel.MouseMove += new MouseEventHandler(title_MouseMove);
     drag = false;
     hidden = false;
     startPos = new Point(0, 0);
     oldSize = this.Size;
     titleLabel.Size = new Size(this.Size.Width - 15, 15);
     titleLabel.BringToFront();
     titleLabel.ContextMenuStrip = titleMenu;
     this.close.BringToFront();
     onTop = false;
     bgColor = gBGColor;
     titleColor = new HSLColor(bgColor);
     borderColor = new HSLColor(bgColor);
     fontColor = gFontColor;
     mOpacity = opaq;
     setColor((int)bgColor.R, (int)bgColor.G, (int)bgColor.B, 1);
     setOpaque(mOpacity);
     nFont = f;
     this.textBox.Font = nFont;
     this.textBox.Lines = tbText;
     startMouse = new Point(0,0);
     endMouse = new Point(0,0);
     resize = false;
 }
Esempio n. 2
0
 void setColor(int r, int g, int b, int caller)
 {
     if (caller == 1)
     {
         bgColor = Color.FromArgb(r, g, b);
         titleColor = new HSLColor(bgColor);
         titleColor.Saturation = titleColor.Saturation * 1.80;
         titleColor.Luminosity = titleColor.Luminosity * 0.90;
         borderColor = new HSLColor(bgColor);
         borderColor.Saturation = borderColor.Saturation * 0.80;
         borderColor.Luminosity = borderColor.Luminosity * 0.80;
         this.titleLabel.BackColor = (Color) titleColor;
         this.close.BackColor = (Color) titleColor;
         this.textBox.BackColor = bgColor;
         this.noteBackGround.BackColor = bgColor;
         this.LeftBorder.BackColor = (Color) borderColor;
         this.RightBorder.BackColor = (Color) borderColor;
         this.BottomBorder.BackColor = (Color) borderColor;
         this.TopBorder.BackColor = (Color) borderColor;
         this.TopBorder2.BackColor = (Color) borderColor;
     }
     if (caller == 2)
     {
         fontColor = Color.FromArgb(r, g, b);
         this.textBox.ForeColor = fontColor;
         this.titleLabel.ForeColor = fontColor;
     }
 }
Esempio n. 3
0
 private static double GetTemp2(HSLColor hslColor)
 {
     double temp2;
     if (hslColor.luminosity < 0.5)  //<=??
         temp2 = hslColor.luminosity * (1.0 + hslColor.saturation);
     else
         temp2 = hslColor.luminosity + hslColor.saturation - (hslColor.luminosity * hslColor.saturation);
     return temp2;
 }