目录

Color

Class Info

public class Color implements Parcelable

颜色信息。

Public Field Summary

Qualifier and Type

Field and Description

int

r

红色,取值[0, 255]。

int

g

绿色,取值[0, 255]。

int

b

蓝色,取值[0, 255]。

int

a

透明度,取值[0, 255]。

Public Constructor Summary

Constructor Name

Color()

无参构造方法。

Color(int r, int g, int b, int a)

构造方法,使用r、g、b、a初始化Color。

Color(Color other)

构造方法,使用其他颜色初始化Color。

Public Method Summary

Qualifier and Type

Method Name and Description

void

setColor(int r, int g, int b, int a)

设置颜色的r、g、b、a值。

Public Fields

[h2]r

Field

public int r

颜色中红色值。

[h2]g

Field

public int g

颜色中绿色值。

[h2]b

Field

public int b

颜色中蓝色值。

[h2]a

Field

public int a

颜色透明度值。

Public Constructors

[h2]Color()

Constructor

public Color()

无参构造方法。

[h2]Color(int r, int g, int b, int a)

Constructor

public Color(int r, int g, int b, int a)

使用r、g、b、a初始化Color。

Parameters

Name

Description

r

红色,取值0-255。

g

绿色,取值0-255。

b

蓝色,取值0-255。

a

透明度,取值0-255。

[h2]Color(Color other)

Constructor

public Color(Color other)

使用其他颜色初始化Color。

Parameters

Name

Description

other

已经初始化的颜色类。

Public Methods

[h2]setColor

Method

public void setColor(int r, int g, int b, int a)

设置颜色的r、g、b、a值。

Parameters

Name

Description

r

红色,取值0-255。

g

绿色,取值0-255。

b

蓝色,取值0-255。

a

透明度,取值0-255。