Skip to content

SixelWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A widget that displays a Sixel image if the terminal supports it, otherwise falls back to rendering the fallback widget.

csharp
[Experimental("HEX1B_SIXEL", UrlFormat = "https://github.com/hex1b/hex1b/blob/main/docs/experimental/sixel.md")]
public sealed record SixelWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<SixelWidget>

Inheritance

ObjectHex1bWidgetSixelWidget

Implements

Constructors

SixelWidget(string, Hex1bWidget, int?, int?)

A widget that displays a Sixel image if the terminal supports it, otherwise falls back to rendering the fallback widget.

Parameters:

  • ImageData (String): The raw Sixel-encoded image data (as a string in Sixel format).
  • Fallback (Hex1bWidget): A widget to display if Sixel is not supported.
  • Width (Nullable<Int32>): The width in character cells for the image. If null, uses the image's natural width.
  • Height (Nullable<Int32>): The height in character cells for the image. If null, uses the image's natural height.
csharp
public SixelWidget(string ImageData, Hex1bWidget Fallback, int? Width = null, int? Height = null)

Properties

Fallback

A widget to display if Sixel is not supported.

Returns: Hex1bWidget

csharp
public Hex1bWidget Fallback { get; init; }

Height

The height in character cells for the image. If null, uses the image's natural height.

Returns: Nullable<Int32>

csharp
public int? Height { get; init; }

ImageData

The raw Sixel-encoded image data (as a string in Sixel format).

Returns: String

csharp
public string ImageData { get; init; }

Width

The width in character cells for the image. If null, uses the image's natural width.

Returns: Nullable<Int32>

csharp
public int? Width { get; init; }

Released under the MIT License.