Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ColorExtensions Class

    Namespace: Stride.Graphics
    Assembly: Stride.dll

    Extension class for Color

    System.Object → ColorExtensions
    Derived from ColorExtensions:

    public static class ColorExtensions
    Name Description
    Methods
    ToColorSpace(Color3, ColorSpace)

    Converts the color in gamma space to the specified ColorSpace.

    ToColorSpace(Color3, ColorSpace, ColorSpace)

    Converts the color from a particualr color space to the specified ColorSpace.

    ToColorSpace(Color4, ColorSpace)

    Converts the color in gamma space to the specified ColorSpace.

    ToColorSpace(Color4, ColorSpace, ColorSpace)

    Converts the color from a particualr color space to the specified ColorSpace.

    WithAlpha(Color, Byte)

    Create a copy of the color with the provided alpha value.

    | Improve this Doc View Source

    Methods


    ToColorSpace(Color3, ColorSpace)

    Converts the color in gamma space to the specified ColorSpace.

    public static Color3 ToColorSpace(this Color3 color, ColorSpace colorSpace)
    Parameters
    Type Name Description
    Color3 color

    The color.

    ColorSpace colorSpace

    The color space.

    Returns
    Type Description
    Color3

    The color converted to the specified color space.


    ToColorSpace(Color3, ColorSpace, ColorSpace)

    Converts the color from a particualr color space to the specified ColorSpace.

    public static Color3 ToColorSpace(this Color3 color, ColorSpace sourceColorSpace, ColorSpace colorSpace)
    Parameters
    Type Name Description
    Color3 color

    The color.

    ColorSpace sourceColorSpace

    The color space of this instance.

    ColorSpace colorSpace

    The color space.

    Returns
    Type Description
    Color3

    The color converted to the specified color space.


    ToColorSpace(Color4, ColorSpace)

    Converts the color in gamma space to the specified ColorSpace.

    public static Color4 ToColorSpace(this Color4 color, ColorSpace colorSpace)
    Parameters
    Type Name Description
    Color4 color

    The color.

    ColorSpace colorSpace

    The color space.

    Returns
    Type Description
    Color4

    The color converted to the specified color space.


    ToColorSpace(Color4, ColorSpace, ColorSpace)

    Converts the color from a particualr color space to the specified ColorSpace.

    public static Color4 ToColorSpace(this Color4 color, ColorSpace sourceColorSpace, ColorSpace colorSpace)
    Parameters
    Type Name Description
    Color4 color

    The color.

    ColorSpace sourceColorSpace

    The color space of this instance.

    ColorSpace colorSpace

    The color space.

    Returns
    Type Description
    Color4

    The color converted to the specified color space.


    WithAlpha(Color, Byte)

    Create a copy of the color with the provided alpha value.

    public static Color WithAlpha(this Color color, byte alpha)
    Parameters
    Type Name Description
    Color color

    The color to take as reference

    System.Byte alpha

    The alpha value of the new color

    Returns
    Type Description
    Color

    The color with the provided alpha value


    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation