Beispiel #1
0
 void TxtHex_TextChanged(object sender, EventArgs e)
 {
     if (TxtHex.Focused)
     {
         FloatingColor color = FloatingColor.FromString(TxtHex.Text);
         if (color != null)
         {
             this.color.R = color.R;
             this.color.G = color.G;
             this.color.B = color.B;
         }
     }
 }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void colorPicker_Pressed(object sender, HandledEventArgs e)
        {
            ColorPicker   cp    = new ColorPicker();
            FloatingColor color = FloatingColor.FromString(Clipboard.GetText(TextDataFormat.Text));

            if (color != null)
            {
                cp.Color = color.ToColor();
            }
            else
            {
                Random r = new Random();
                cp.Color = Color.FromArgb(r.Next(0, 255), r.Next(0, 255), r.Next(0, 255));
            }
            cp.Show();
            cp.Focus();
        }