# IconContext class

Namespace: [Grasshopper2.UI.Icon](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.icon.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class IconContext
```

Context used during the rendering of icons. It encodes both the transformation from icon to render space, as well as the estimated background colour.

## Constructors

- [IconContext](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/ctor.md): (2 overloads) Create a new icon context.

## Properties

- [Background](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/background.md): Gets the average/estimated background colour for this icon.
- [Context](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/context.md): Gets the graphics context for this draw event.
- [Filter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/filter.md): Gets the filter to apply to icon colours. Note that this may not affect all colours used by icons.
- [Frame](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/frame.md): Gets the dimensions of the target frame.
- [FrameVisualSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/framevisualsize.md): Gets the smallest visual dimensions of the frame. This equals the Min(Width, Height) multiplied by the zoom.
- [Palette](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/palette.md): Gets the icon palette tied to this context.
- [Scaling](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/scaling.md): Gets the scaling factor for the current context state. The scaling is computed by dividing the Frame size by the icon size as part of [IconContext.SetupTransform(SizeF)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/setuptransform.md).
- [Zoom](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/zoom.md): Gets the zoom factor of the frame graphics. Typically you do not need to do anything with this, but some vector graphics elements may choose to alter their display based on their final physical size.

## Methods

- [AddSpecialColoursToMenu](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/addspecialcolourstomenu.md): (static) Add all defined special icon colours to a menu.
- [MakeSpecialColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/makespecialcolour.md): (static) Create an ARGB colour which hints at a special colour.
- [Modify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/modify.md): Modify this context.
- [ResolveSpecialColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/resolvespecialcolour.md): (2 overloads) Resolve a special colour, leave regular colours unmolested.
- [SetupTransform](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/setuptransform.md): Set up the required transformation details for a specific icon. This method *must* be called before any of the Transform methods are invoked.
- [Transform](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/transform.md): (10 overloads) Transform an arc into frame space.
- [WithDisabledFilter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/withdisabledfilter.md): Modify the filter of this context to the standard disabled filter.
- [WithFadingFilter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/withfadingfilter.md): Modify the filter of this context to the standard blending filter.
- [WithFilter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/withfilter.md): Modify the filter of this context.
- [WithGreyscaleFilter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/withgreyscalefilter.md): Modify the filter of this context to the standard disabled filter.
- [WithPalette](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.icon.iconcontext/withpalette.md): Assign a new icon palette to this context.
