Tag Archives: colors

Animate rainbow colors in C#

The example Map numeric values to and from colors in a color gradient in C# draws a color gradient that uses rainbow colors. This example animates that one. When you click on the color gradient, the following code starts or … Continue reading

Posted in algorithms, animation, graphics, mathematics | Tagged , , , , , , , , , , , , , , , | Leave a comment

Save a color palette in a program’s settings in C#

The example Make a persistent color palette in C# shows how a program can use settings to save and restore a color palette. The program saves the palette colors as a list of ARGB color values stored in a string … Continue reading

Posted in arrays, drawing, graphics, settings | Tagged , , , , , , , , , , , , | Leave a comment

Make a persistent color palette in C#

This example saves and restores the colors in a color palette when it starts and stops. It also lets the user click on a color in the palette to change its value. The program stores the colors in an array … Continue reading

Posted in drawing, graphics, settings | Tagged , , , , , , , , , , , | 1 Comment

Make a standard color palette in C#

The MakeColorPalette method shown below builds an array of PictureBoxes with BackColor properties set to a standard color palette. // Make a color palette on the given parent. private void MakeColorPalette(Control parent, int x, int y, System.EventHandler event_handler) { Color[] … Continue reading

Posted in controls, drawing, graphics | Tagged , , , , , , , , , , , | 1 Comment

List colors in WPF and C#

This example shows how to list colors and display color samples in a WPF ListBox. To build the list, the example demonstrates reflection, LINQ, and XAML data templates. The program uses the following XAML code to define the ListBox that … Continue reading

Posted in drawing, enums, graphics, LINQ, reflection, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Draw a color wheel with alpha and saturation values in C#

The example Draw a colorful color wheel in C# shows how to draw a color wheel. This example lets you use scroll bars to change the alpha (opaqueness) and saturation (grayness) values of the colors. This is actually a pretty … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , , , , , , | 1 Comment

Draw a colorful color wheel in C#

The example Draw a color wheel in C# draws a color wheel. To do that, it makes a series of points along the perimeter of a circle where each point has a different color of the rainbow. It then makes … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , , , | 3 Comments

Draw a color wheel in C#

The program uses a PathGradientBrush to fill a color wheel with color samples. Drawing the wheel is basically automatic but takes some effort to set up. The following DrawColorWheel method draws does all the work. // Draw a color wheel … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , , , | Leave a comment

Let the user zoom on a picture in C#

The example Provide autosave in C# explains how to make a program that lets the user draw lines in different colors and styles. That program lets the user undo and redo, save and load drawings, and autosaves so it can … Continue reading

Posted in drawing, files, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Provide autosave in C#

This example extends the scribble example (most recently described in the post Provide undo and redo in C#) so it provides an auto-save feature. The following code creates the name of the program’s auto-save file. // The auto-save file name. … Continue reading

Posted in drawing, files, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 1 Comment