Color
Declaration
public struct Strawberry.Graphics.Color
Represents a Color
Constructors
Color
create a Color using r,g,b,a values from 0.0 to 1.0
void Color(float r, float g, float b, float a)
Parameters:
| Name | Type | Description |
|---|---|---|
r |
System.Single |
Red value of the color |
g |
System.Single |
Green value of the color |
b |
System.Single |
Blue value of the color |
a |
System.Single |
Alpha value of the color used for transparency. 1.0=fully opaque,0.0=fully transparent |
Color
create a Color using r,g,b,a values from 0 to 255
void Color(byte r, byte g, byte b, byte a)
Parameters:
| Name | Type | Description |
|---|---|---|
r |
System.Byte |
Red value of the color |
g |
System.Byte |
Green value of the color |
b |
System.Byte |
Blue value of the color |
a |
System.Byte |
Alpha value of the color used for transparency. 255=fully opaque,0=fully transparent |
Color
Creates a color using an unsigned integer. You can use hex values
void Color(uint color)
Parameters:
| Name | Type | Description |
|---|---|---|
color |
System.UInt32 |
The color code |
Color
Creates a color from an existing color with a new alpha (transparnecy) value
void Color(Color color, float alpha)
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Strawberry.Graphics.Color |
The old color |
alpha |
System.Single |
Properties
R
Red value of the color from 0.0 to 1.0
float R { get set }
G
Green value of the color from 0.0 to 1.0
float G { get set }
B
Blue value of the color from 0.0 to 1.0
float B { get set }
A
Alpha value of the color from 0.0 to 1.0 used for transparency. 1.0=fully opaque,0.0=fully transparent
float A { get set }
White static
Color White { get }
Black static
Color Black { get }
Silver static
Color Silver { get }
Gray static
Color Gray { get }
Red static
Color Red { get }
Green static
Color Green { get }
Blue static
Color Blue { get }
CornflowerBlue static
Color CornflowerBlue { get }
Orange static
Color Orange { get }
Cyan static
Color Cyan { get }
DarkBlue static
Color DarkBlue { get }
LightBlue static
Color LightBlue { get }
Purple static
Color Purple { get }
Yellow static
Color Yellow { get }
Lime static
Color Lime { get }
Magenata static
Color Magenata { get }
HotPink static
Color HotPink { get }
LightPink static
Color LightPink { get }
Pink static
Color Pink { get }
DeepPink static
Color DeepPink { get }
Brown static
Color Brown { get }
Maroon static
Color Maroon { get }
Transparent static
Color Transparent { get }
Methods
Equals override
bool Equals(object obj)
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
System.Object |
ToString override
string ToString()
GetHashCode override
int GetHashCode()
ToHex
string ToHex()
Operators
op_Equality static
bool op_Equality(Color c1, Color c2)
Parameters:
| Name | Type | Description |
|---|---|---|
c1 |
Strawberry.Graphics.Color |
|
c2 |
Strawberry.Graphics.Color |
op_Inequality static
bool op_Inequality(Color c1, Color c2)
Parameters:
| Name | Type | Description |
|---|---|---|
c1 |
Strawberry.Graphics.Color |
|
c2 |
Strawberry.Graphics.Color |