Class Color

Class Color

名称: Aspose.Html.Drawing 编辑: Aspose.HTML.dll (25.4.0)

颜色类允许您指定颜色为红绿蓝(RGB)值HSL(Hue-Saturation-Luminosity)值Hue-Saturation-Value (HSV) 值Hue-Whiteness-Blackness (HWB) 值,光度A-B(LAB)值,Luminance-Chroma-Hue (LCH) 值Cyan-Magenta-Yellow-Key (CMYK) 值自然颜色(NCOL)值或者用色彩名称。还有一个阿尔法频道可以显示透明度。

[ComVisible(true)]
public class Color

Inheritance

object Color

继承人

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

Color()

启动了 Aspose.Html.Drawing.Color 类的新例子。默认颜色是黑色。

public Color()

Color(航海、航海、航海)

启动了 Aspose.Html.Drawing.Color 类的新例子。所有颜色组件都必须在0-1范围内。

public Color(float red, float green, float blue)

Parameters

red float

颜色的红色组成部分。

green float

是颜色的绿色组成部分。

blue float

颜色的蓝色组成部分。

Color(航海、航海、航海、航海)

启动了 Aspose.Html.Drawing.Color 类的新例子。所有颜色组件都必须在0-1范围内。

public Color(float red, float green, float blue, float alpha)

Parameters

red float

颜色的红色组成部分。

green float

是颜色的绿色组成部分。

blue float

颜色的蓝色组成部分。

alpha float

颜色的阿尔法组成部分。

Color(比特、比特、比特)

启动了 Aspose.Html.Drawing.Color 类的新例子。所有颜色组件都必须在 0-255 范围内。

public Color(byte red, byte green, byte blue)

Parameters

red byte

颜色的红色组成部分。

green byte

是颜色的绿色组成部分。

blue byte

颜色的蓝色组成部分。

Color(比特、比特、比特、比特)

启动了 Aspose.Html.Drawing.Color 类的新例子。所有颜色组件都必须在 0-255 范围内。

public Color(byte red, byte green, byte blue, byte alpha)

Parameters

red byte

一个比特代表颜色的红色组成部分。

green byte

一个比特,代表颜色的绿色组成部分。

blue byte

一个比特代表颜色的蓝色组成部分。

alpha byte

一个比特代表颜色的阿尔法组成部分。

Color(int , int , int , int)

启动了 Aspose.Html.Drawing.Color 类的新例子。所有颜色组件都必须在 0-255 范围内。

public Color(int red, int green, int blue)

Parameters

red int

颜色的红色组成部分。

green int

是颜色的绿色组成部分。

blue int

颜色的蓝色组成部分。

Color(int , int , int , int , int)

启动了 Aspose.Html.Drawing.Color 类的新例子。所有颜色组件都必须在 0-255 范围内。

public Color(int red, int green, int blue, int alpha)

Parameters

red int

颜色的红色组成部分。

green int

是颜色的绿色组成部分。

blue int

颜色的蓝色组成部分。

alpha int

颜色的阿尔法组成部分。

Properties

Alpha

代表颜色的阿尔法组成部分。

public float Alpha { get; }

财产价值

float

Blue

代表颜色的蓝色组成部分。

public float Blue { get; }

财产价值

float

Green

代表颜色的绿色组成部分。

public float Green { get; }

财产价值

float

Red

代表颜色的红色组成部分

public float Red { get; }

财产价值

float

Methods

AddLuminosity(航海)

创建颜色的副本,其亮度和德尔塔值的总和。

public Color AddLuminosity(float delta)

Parameters

delta float

光明的价值

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

Convert(ColorModel)

返回指定的颜色模型的格式中的颜色组件。

public IColorComponents Convert(ColorModel model)

Parameters

model ColorModel

颜色模型。

Returns

IColorComponents

Aspose.Html.Drawing.IColor 组件界面的新例子

Equals(对象)

确定所指定的 Aspose.Html.Drawing.Color 是否与此例相同。

public override bool Equals(object obj)

Parameters

obj object

系统.对象与这个例子进行比较。

Returns

bool

“真实”如果指定的 System.Object 等于此例;否则,“虚假”。

FromCmyk(航海、航海、航海、航海)

返回新颜色与所需的、黄、关键(黑)值。

public static Color FromCmyk(float cyan, float magenta, float yellow, float key)

Parameters

cyan float

象征着颜色的西安组成部分。

magenta float

象征着颜色的磁性组成部分。

yellow float

象征着颜色的黄色组成部分。

key float

象征着颜色的关键组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromCmyka(航海、航海、航海、航海、航海)

返回一个新的颜色与所需的,,黄,关键(黑色),阿尔法值。

public static Color FromCmyka(float cyan, float magenta, float yellow, float key, float alpha)

Parameters

cyan float

象征着颜色的西安组成部分。

magenta float

象征着颜色的磁性组成部分。

yellow float

象征着颜色的黄色组成部分。

key float

象征着颜色的关键组成部分。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromGray(航海)

返回新颜色与所需的灰色值。

public static Color FromGray(float gray)

Parameters

gray float

象征着颜色的灰色值。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromHsl(航海、航海、航海)

返回一个新的颜色与所需的、饱和、饱和值。

public static Color FromHsl(float hue, float saturation, float lightness)

Parameters

hue float

象征着色彩的色彩组成部分的浮动。

saturation float

代表色彩的饱和组成部分的浮动。

lightness float

表面代表颜色的轻度组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromHsla(航海、航海、航海、航海)

返回一个新的颜色与所需的、饱和、饱和、阿尔法值。

public static Color FromHsla(float hue, float saturation, float lightness, float alpha)

Parameters

hue float

象征着色彩的色彩组成部分的浮动。

saturation float

代表色彩的饱和组成部分的浮动。

lightness float

表面代表颜色的轻度组成部分。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromHsv(航海、航海、航海)

返回一个新的颜色与所需的颜色,饱和,值。

public static Color FromHsv(float hue, float saturation, float value)

Parameters

hue float

象征着色彩的色彩组成部分的浮动。

saturation float

代表色彩的饱和组成部分的浮动。

value float

代表颜色的价值组成部分的浮动。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromHsva(航海、航海、航海、航海)

返回一个新的颜色与所需的,饱和,值,阿尔法。

public static Color FromHsva(float hue, float saturation, float value, float alpha)

Parameters

hue float

象征着色彩的色彩组成部分的浮动。

saturation float

代表色彩的饱和组成部分的浮动。

value float

代表颜色的价值组成部分的浮动。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromHwb(航海、航海、航海)

返回一个新的颜色与所需的颜色,白色,黑色值。

public static Color FromHwb(float hue, float whiteness, float blackness)

Parameters

hue float

象征着色彩的色彩组成部分的浮动。

whiteness float

象征着颜色的白色组成部分。

blackness float

象征着颜色的黑色组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromHwba(航海、航海、航海、航海)

返回一个新的颜色与所需的颜色,白色,黑色值。

public static Color FromHwba(float hue, float whiteness, float blackness, float alpha)

Parameters

hue float

象征着色彩的色彩组成部分的浮动。

whiteness float

象征着颜色的白色组成部分。

blackness float

象征着颜色的黑色组成部分。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromInt(因特)

返回新颜色与要求的 ARGB 值。

public static Color FromInt(int argb)

Parameters

argb int

代表颜色的ARGB值的 int。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromLab(航海、航海、航海)

返回一个新的颜色与所需的亮度,A,B值。

public static Color FromLab(float lightness, float a, float b)

Parameters

lightness float

表面代表颜色的轻度组成部分。

a float

象征着颜色的A组成部分。

b float

象征着颜色的B组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromLaba(航海、航海、航海、航海)

返回一个新的颜色与所需的轻度,A,B,阿尔法值。

public static Color FromLaba(float lightness, float a, float b, float alpha)

Parameters

lightness float

表面代表颜色的轻度组成部分。

a float

象征着颜色的A组成部分。

b float

象征着颜色的B组成部分。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromLch(航海、航海、航海)

返回一个新的颜色与所需的亮度,Chroma,Hue值。

public static Color FromLch(float luminance, float chroma, float hue)

Parameters

luminance float

代表色彩的光明组成部分的浮动。

chroma float

象征着颜色的染色组成部分。

hue float

象征着色彩的色彩组成部分的浮动。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromLcha(航海、航海、航海、航海)

返回一个新的颜色与所需的亮度,Chroma,Hue,Alpha值。

public static Color FromLcha(float luminance, float chroma, float hue, float alpha)

Parameters

luminance float

代表色彩的光明组成部分的浮动。

chroma float

象征着颜色的染色组成部分。

hue float

象征着色彩的色彩组成部分的浮动。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromOklab(航海、航海、航海)

返回一个新的颜色与所需的轻度,A,B值为OKLAB模型。

public static Color FromOklab(float lightness, float a, float b)

Parameters

lightness float

表面代表颜色的轻度组成部分。

a float

象征着颜色的A组成部分。

b float

象征着颜色的B组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromOklaba(航海、航海、航海、航海)

返回一个新的颜色与所需的轻度,A,B,Alpha值为OKLAB模型。

public static Color FromOklaba(float lightness, float a, float b, float alpha)

Parameters

lightness float

表面代表颜色的轻度组成部分。

a float

象征着颜色的A组成部分。

b float

象征着颜色的B组成部分。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromOklch(航海、航海、航海)

返回一个新的颜色,为 OKLAB 模型提供所需的亮度、Chroma、Hue 值。

public static Color FromOklch(float luminance, float chroma, float hue)

Parameters

luminance float

代表色彩的光明组成部分的浮动。

chroma float

象征着颜色的染色组成部分。

hue float

象征着色彩的色彩组成部分的浮动。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromOklcha(航海、航海、航海、航海)

返回一个新的颜色,为 OKLAB 模型提供所需的光度、Chroma、Hue、Alpha 值。

public static Color FromOklcha(float luminance, float chroma, float hue, float alpha)

Parameters

luminance float

代表色彩的光明组成部分的浮动。

chroma float

象征着颜色的染色组成部分。

hue float

象征着色彩的色彩组成部分的浮动。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromRgb(比特、比特、比特)

返回新颜色与所需的绿色、蓝色值。所有颜色组件都必须在 0-255 范围内。

public static Color FromRgb(byte red, byte green, byte blue)

Parameters

red byte

一个比特代表颜色的红色组成部分。

green byte

一个比特,代表颜色的绿色组成部分。

blue byte

一个比特代表颜色的蓝色组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromRgb(int , int , int , int)

返回新颜色与所需的绿色、蓝色值。所有颜色组件都必须在 0-255 范围内。

public static Color FromRgb(int red, int green, int blue)

Parameters

red int

它代表了颜色的红色组成部分。

green int

它代表了颜色的绿色组成部分。

blue int

代表蓝色组成部分的 int。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromRgb(航海、航海、航海)

返回新颜色与所需的绿色、蓝色值。所有颜色组件都必须在0-1范围内。

public static Color FromRgb(float red, float green, float blue)

Parameters

red float

代表颜色的红色组成部分的浮动。

green float

表面代表绿色组成部分的颜色。

blue float

象征着颜色的蓝色组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromRgba(比特、比特、比特、比特)

返回新颜色与所需的黄色、绿色、蓝色、阿尔法值。所有颜色组件都必须在 0-255 范围内。

public static Color FromRgba(byte red, byte green, byte blue, byte alpha)

Parameters

red byte

一个比特代表颜色的红色组成部分。

green byte

一个比特,代表颜色的绿色组成部分。

blue byte

一个比特代表颜色的蓝色组成部分。

alpha byte

一个比特代表颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromRgba(int , int , int , int , int)

返回新颜色与所需的黄色、绿色、蓝色、阿尔法值。所有颜色组件都必须在 0-255 范围内。

public static Color FromRgba(int red, int green, int blue, int alpha)

Parameters

red int

它代表了颜色的红色组成部分。

green int

它代表了颜色的绿色组成部分。

blue int

代表蓝色组成部分的 int。

alpha int

它代表了颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromRgba(航海、航海、航海、航海)

返回新颜色与所需的黄色、绿色、蓝色、阿尔法值。所有颜色组件都必须在0-1范围内。

public static Color FromRgba(float red, float green, float blue, float alpha)

Parameters

red float

代表颜色的红色组成部分的浮动。

green float

表面代表绿色组成部分的颜色。

blue float

象征着颜色的蓝色组成部分。

alpha float

象征着颜色的阿尔法组成部分。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromString(线条)

切断包含 CSS 颜色的行,并返回新的颜色。

public static Color FromString(string color)

Parameters

color string

包含 RGB、HEX、HSL、HSV、HWB、CMYK、NCOL、LCH、OKLCH、LAB 或 OKLAB 格式的颜色。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

FromUint(乌恩特)

返回新颜色与要求的 ARGB 值。

public static Color FromUint(uint argb)

Parameters

argb uint

代表颜色的ARGB值。

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

GetComplementary()

返回一个新的颜色,从原始的颜色轮子的反面。

public Color GetComplementary()

Returns

Color

新例子是 Aspose.Html.Drawing.Color 类。

GetHashCode()

返回Hash代码。

public override int GetHashCode()

Returns

int

一个Hash代码。

GetHue()

返回一片色彩。

public float GetHue()

Returns

float

一种颜色的皮肤。

GetLuminosity()

恢复色彩的亮度。

public float GetLuminosity()

Returns

float

色彩的亮度。

GetSaturation()

恢复色彩的饱和。

public float GetSaturation()

Returns

float

色彩的饱和。

ToInt()

暗号颜色 ARGB 组件到 int。

public int ToInt()

Returns

int

编码了。

ToName()

返回颜色的名称,如果它符合CSS名称的颜色列表中的颜色,或一个空线。

public string ToName()

Returns

string

色彩名称

ToNaturalColorString(因特)

返回自然颜色(NCol)指定的颜色,使用颜色字母与数字指定距离(百分比)的颜色。

public string ToNaturalColorString(int digits)

Parameters

digits int

设置颜色组件的旋转准确性。

Returns

string

自然色彩(NCol)

ToRgbHexString()

返回一个六分之一的颜色是指定的: #RRGGBB。

public string ToRgbHexString()

Returns

string

一个 hexadecimal 色彩线。

ToRgbString()

返回包含 RGB 指定的颜色的行: rgb(R、G、B)。

public string ToRgbString()

Returns

string

一条RGB线。

ToRgbaHexString()

返回 Hexadecimal 颜色是指定的: #RRGGBBAA。

public string ToRgbaHexString()

Returns

string

以 Hexadecimal 色彩线。

ToRgbaString()

返回包含 RGBA 指定的颜色: rgba(R、G、B、A)。

public string ToRgbaString()

Returns

string

一个rgba string。

ToString()

返回由 RGBA 组件值组成的序列。

public override string ToString()

Returns

string

人可读的线条。

ToUint()

将颜色 ARGB 组件暗号化为未签名的 int。

public uint ToUint()

Returns

uint

编码未签名。

WithAlpha(航海)

创建复印件的颜色与指定的阿尔法组件。

public Color WithAlpha(float alpha)

Parameters

alpha float

阿尔法组件的价值

Returns

Color

Aspose.Html.Drawing.Color 类的新例子

WithHue(航海)

创建与指定的色彩复印件。

public Color WithHue(float hue)

Parameters

hue float

Hue 的價值

Returns

Color

>A 新例子的Aspose.Html.Drawing.Color类。

WithLuminosity(航海)

创建与指定亮度的颜色副本。

public Color WithLuminosity(float luminosity)

Parameters

luminosity float

光明的价值

Returns

Color

新例子是 Aspose.Html.Drawing.Color 类。

WithSaturation(航海)

创建与规定的饱和度的颜色副本。

public Color WithSaturation(float saturation)

Parameters

saturation float

饱和的价值。

Returns

Color

>A 新例子的Aspose.Html.Drawing.Color类。

 中文