Artemis Artemis
Artemis Artemis

Search Results for

    Class ColorGradient

    A gradient containing a list of ColorGradientStops

    Inheritance
    object
    ColorGradient
    Implements
    IList<ColorGradientStop>
    ICollection<ColorGradientStop>
    IEnumerable<ColorGradientStop>
    IList
    ICollection
    IEnumerable
    INotifyCollectionChanged
    Namespace: Artemis.Core
    Assembly: Artemis.Core.dll
    Syntax
    public class ColorGradient : IList<ColorGradientStop>, ICollection<ColorGradientStop>, IEnumerable<ColorGradientStop>, IList, ICollection, IEnumerable, INotifyCollectionChanged

    Constructors

    ColorGradient()

    Creates a new instance of the ColorGradient class

    Declaration
    public ColorGradient()

    ColorGradient(ColorGradient?)

    Creates a new instance of the ColorGradient class

    Declaration
    public ColorGradient(ColorGradient? colorGradient)
    Parameters
    Type Name Description
    ColorGradient colorGradient

    The color gradient to copy

    ColorGradient(List<ColorGradientStop>)

    Creates a new instance of the ColorGradient class

    Declaration
    public ColorGradient(List<ColorGradientStop> stops)
    Parameters
    Type Name Description
    List<ColorGradientStop> stops

    The stops to copy

    Properties

    Colors

    Gets an array containing the colors of the color gradient.

    Note: Making changes to this array will not be reflected on the gradient, is is essentially read-only.
    Declaration
    public SKColor[] Colors { get; }
    Property Value
    Type Description
    SKColor[]

    Count

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    IsFixedSize

    Declaration
    public bool IsFixedSize { get; }
    Property Value
    Type Description
    bool

    IsReadOnly

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    bool

    IsSynchronized

    Declaration
    public bool IsSynchronized { get; }
    Property Value
    Type Description
    bool

    this[int]

    Declaration
    public ColorGradientStop this[int index] { get; set; }
    Parameters
    Type Name Description
    int index
    Property Value
    Type Description
    ColorGradientStop

    Positions

    Gets an array containing the positions of colors of the color gradient.

    Note: Making changes to this array will not be reflected on the gradient, is is essentially read-only.
    Declaration
    public float[] Positions { get; }
    Property Value
    Type Description
    float[]

    SyncRoot

    Declaration
    public object SyncRoot { get; }
    Property Value
    Type Description
    object

    Methods

    Add(ColorGradientStop)

    Declaration
    public void Add(ColorGradientStop item)
    Parameters
    Type Name Description
    ColorGradientStop item

    Add(object?)

    Declaration
    public int Add(object? value)
    Parameters
    Type Name Description
    object value
    Returns
    Type Description
    int

    Clear()

    Declaration
    public void Clear()

    Contains(ColorGradientStop)

    Declaration
    public bool Contains(ColorGradientStop item)
    Parameters
    Type Name Description
    ColorGradientStop item
    Returns
    Type Description
    bool

    Contains(object?)

    Declaration
    public bool Contains(object? value)
    Parameters
    Type Name Description
    object value
    Returns
    Type Description
    bool

    CopyTo(ColorGradientStop[], int)

    Declaration
    public void CopyTo(ColorGradientStop[] array, int arrayIndex)
    Parameters
    Type Name Description
    ColorGradientStop[] array
    int arrayIndex

    CopyTo(Array, int)

    Declaration
    public void CopyTo(Array array, int index)
    Parameters
    Type Name Description
    Array array
    int index

    Equals(ColorGradient)

    Determines whether all the stops in this gradient are equal to the stops in the given other gradient.

    Declaration
    protected bool Equals(ColorGradient other)
    Parameters
    Type Name Description
    ColorGradient other

    The other gradient to compare to

    Returns
    Type Description
    bool

    Equals(object?)

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)

    FlipStops()

    Flips the stops of the gradient.

    Declaration
    public void FlipStops()

    GetColor(float)

    Gets a color at any position between 0.0 and 1.0 using interpolation

    Declaration
    public SKColor GetColor(float position)
    Parameters
    Type Name Description
    float position

    A position between 0.0 and 1.0

    Returns
    Type Description
    SKColor

    GetColor(float, int, bool)

    Gets a color at any position between 0.0 and 1.0 using interpolation

    Declaration
    [Obsolete("Use GetColor(float position) instead.", true)]
    public SKColor GetColor(float position, int timesToRepeat = 0, bool seamless = false)
    Parameters
    Type Name Description
    float position

    A position between 0.0 and 1.0

    int timesToRepeat

    The amount of times to repeat the positions

    bool seamless

    A boolean indicating whether to make the gradient seamless by adding the first color behind the last color

    Returns
    Type Description
    SKColor

    GetColorsArray(int, bool)

    Gets all the colors in the color gradient

    Declaration
    [Obsolete("Use the Colors property instead", true)]
    public SKColor[] GetColorsArray(int timesToRepeat = 0, bool seamless = false)
    Parameters
    Type Name Description
    int timesToRepeat

    The amount of times to repeat the colors

    bool seamless

    A boolean indicating whether to make the gradient seamless by adding the first color behind the last color

    Returns
    Type Description
    SKColor[]

    An array containing each color in the gradient

    GetEnumerator()

    Declaration
    public IEnumerator<ColorGradientStop> GetEnumerator()
    Returns
    Type Description
    IEnumerator<ColorGradientStop>

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()

    GetPositionsArray(int, bool)

    Gets all the positions in the color gradient

    Declaration
    [Obsolete("Use the Positions property instead", true)]
    public float[] GetPositionsArray(int timesToRepeat = 0, bool seamless = false)
    Parameters
    Type Name Description
    int timesToRepeat

    The amount of times to repeat the positions

    bool seamless

    A boolean indicating whether to make the gradient seamless by adding the first color behind the last color

    Returns
    Type Description
    float[]

    An array containing a position for each color between 0.0 and 1.0

    GetRandom(int)

    Gets a new ColorGradient with random colors from the HSV-spectrum

    Declaration
    public static ColorGradient GetRandom(int stops)
    Parameters
    Type Name Description
    int stops

    The amount of stops to add

    Returns
    Type Description
    ColorGradient

    GetUnicornBarf()

    Gets a new ColorGradient with colors looping through the HSV-spectrum

    Declaration
    public static ColorGradient GetUnicornBarf()
    Returns
    Type Description
    ColorGradient

    IndexOf(ColorGradientStop)

    Declaration
    public int IndexOf(ColorGradientStop item)
    Parameters
    Type Name Description
    ColorGradientStop item
    Returns
    Type Description
    int

    IndexOf(object?)

    Declaration
    public int IndexOf(object? value)
    Parameters
    Type Name Description
    object value
    Returns
    Type Description
    int

    Insert(int, ColorGradientStop)

    Declaration
    public void Insert(int index, ColorGradientStop item)
    Parameters
    Type Name Description
    int index
    ColorGradientStop item

    Insert(int, object?)

    Declaration
    public void Insert(int index, object? value)
    Parameters
    Type Name Description
    int index
    object value

    Interpolate(ColorGradient, float)

    Interpolates a color gradient between the this gradient and the provided targetValue.

    Declaration
    public ColorGradient Interpolate(ColorGradient targetValue, float progress)
    Parameters
    Type Name Description
    ColorGradient targetValue

    The second color gradient.

    float progress

    A value between 0 and 1.

    Returns
    Type Description
    ColorGradient

    The interpolated color gradient.

    IsSeamless()

    Determines whether the gradient is seamless

    Declaration
    public bool IsSeamless()
    Returns
    Type Description
    bool

    true if the gradient is seamless; false otherwise

    Randomize(int)

    Randomizes the color gradient with the given amount of stops.

    Declaration
    public void Randomize(int stops)
    Parameters
    Type Name Description
    int stops

    The amount of stops to put into the gradient.

    Remove(ColorGradientStop)

    Declaration
    public bool Remove(ColorGradientStop item)
    Parameters
    Type Name Description
    ColorGradientStop item
    Returns
    Type Description
    bool

    Remove(object?)

    Declaration
    public void Remove(object? value)
    Parameters
    Type Name Description
    object value

    RemoveAt(int)

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    int index

    RotateStops(bool)

    Rotates the stops of the gradient shifting every stop over to the position of it's neighbor and wrapping around at the end of the gradient.

    Declaration
    public void RotateStops(bool inverse)
    Parameters
    Type Name Description
    bool inverse

    A boolean indicating whether or not the invert the rotation.

    SpreadStops()

    Spreads the color stops equally across the gradient.

    Declaration
    public void SpreadStops()

    ToggleSeamless()

    If not already the case, makes the gradient seamless by adding the first color to the end of the gradient and compressing the other stops.

    If the gradient is already seamless, removes the last color and spreads the remaining stops to fill the freed space.

    Declaration
    public void ToggleSeamless()

    Events

    CollectionChanged

    Declaration
    public event NotifyCollectionChangedEventHandler? CollectionChanged
    Event Type
    Type Description
    NotifyCollectionChangedEventHandler

    StopChanged

    Occurs when any of the stops has changed in some way

    Declaration
    public event EventHandler? StopChanged
    Event Type
    Type Description
    EventHandler

    Implements

    IList<T>
    ICollection<T>
    IEnumerable<T>
    IList
    ICollection
    IEnumerable
    INotifyCollectionChanged
    Content is available under the PolyForm Noncommercial License, by Artemis RGB.