Skip to main content
InkDrawingAttributes.Color | color property

Applies to Windows only

Gets or sets a value that indicates the color of an InkStroke.

Syntax


var color = inkDrawingAttributes.color;
inkDrawingAttributes.color = color;

public Color Color { get; set; }

Public Property Color As Color

public:
property Color Color { 
   Color get();
   void set (Color value);
}

Property value

Type: Color

The ink color. Default value is black.

Examples

The following example demonstrates how to set the Color property (color) of an InkStroke (stroke) using the Windows.UI.ColorHelper.FromArgb method.


var drawingAttributes = stroke.drawingAttributes;
drawingAttributes.color = 
     Windows.UI.ColorHelper.fromArgb(255, 255, 0, 0);
stroke.drawingAttributes = drawingAttributes;

The following alternative demonstrates how to set the Color property (color) of an InkStroke (stroke) without using the Windows.UI.ColorHelper.FromArgb method.


var drawingAttributes = stroke.drawingAttributes;
var color = drawingAttributes.color;
color.a = 255;
color.r = 255;
color.g = 0;
color.b = 0;
drawingAttributes.color = color;
stroke.drawingAttributes = drawingAttributes;

For the complete example, see Ink App sample.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.UI.Input.Inking
Windows::UI::Input::Inking [C++]

Metadata

Windows.winmd

See also

InkDrawingAttributes
Responding to pen and stylus input
Ink App sample