private void m_colorBox_Click(object sender, EventArgs e) { if (PropertyModel != null) { ColorDialog dialog = new ColorDialog(); PlayCanvas.Color color = PropertyModel.Data<PlayCanvas.Color>(); dialog.Color = Color.FromArgb( 0, (int)(color.R * 255.0f), (int)(color.G * 255.0f), (int)(color.B * 255.0f) ); if (dialog.ShowDialog() == DialogResult.OK) { color = new PlayCanvas.Color( (float)dialog.Color.R / 255.0f, (float)dialog.Color.G / 255.0f, (float)dialog.Color.B / 255.0f, color.A ); PropertyModel.Data<PlayCanvas.Color>(color); UpdateEditor(); } } }
private void m_alphaTrack_ValueChanged(object sender, EventArgs e) { if (PropertyModel != null) { PlayCanvas.Color color = PropertyModel.Data<PlayCanvas.Color>(); color = new PlayCanvas.Color( color.R, color.G, color.B, (float)m_alphaTrack.Value / (float)m_alphaTrack.Maximum ); if (!m_preventUpdateEditor) m_alphaTextBox.Text = m_alphaTrack.Value.ToString(CultureInfo.InvariantCulture); PropertyModel.Data<PlayCanvas.Color>(color); UpdateEditor(); m_alphaTextBox.Refresh(); } }