ColorPalette.cs
// Copyright 2010 ESRI // // All rights reserved under the copyright laws of the United States // and applicable international laws, treaties, and conventions. // // You may freely redistribute and use this sample code, with or // without modification, provided you include the original copyright // notice and use restrictions. // // See the use restrictions. // using System.Windows.Forms; using System.Drawing; namespace GlobeGraphicsToolbar { public class ColorPalette { private ColorDialog _colorDialog; public ColorPalette() { _colorDialog = new ColorDialog(); InitializeUI(); SetDefaultColor(); } private void InitializeUI() { _colorDialog.FullOpen = true; } private void SetDefaultColor() { _colorDialog.Color = Color.Yellow; } public bool IsColorSelected() { return _colorDialog.ShowDialog() == DialogResult.OK; } public int Red { get { return (int)_colorDialog.Color.R; } } public int Green { get { return (int)_colorDialog.Color.G; } } public int Blue { get { return (int)_colorDialog.Color.B; } } } }