s&
info
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
explore
Discover Games
category
Workshop
sports_esports
Games
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
menu_book
Learn
docs
Documentation
api
Api Reference
school
Tutorials
manage_search
Code Search
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
Color32
chevron_left
Classes
struct
Color32
Constructors
functions
Color32
Fields
crop_din
a
crop_din
b
crop_din
g
crop_din
r
Properties
data_object
Hex
data_object
RawInt
data_object
Rgb
data_object
Rgba
data_object
RgbaInt
data_object
RgbInt
Methods
functions
LerpTo
functions
ToColor
functions
Write
Static Properties
data_object
Black
data_object
Transparent
data_object
White
Static Methods
functions
FromRgb
functions
FromRgba
functions
Lerp
functions
Max
functions
Min
functions
Parse
functions
Read
Color32
A 32bit color, commonly used by things like vertex buffers. The functionality on this is purposely left minimal so we're encouraged to use the regular Color struct.
struct
sealed
Sandbox.System
build
Constructors
1
Color32
(
r
,
g
,
b
,
a
)
Initialize a color with each component set to given values, in range [0,255]
crop_din
Fields
4
a
Byte
The alpha/transparency color component, in range of 0 (fully transparent) to 255 (fully opaque).
b
Byte
The blue color component, in range of 0-255.
g
Byte
The green color component, in range of 0-255.
r
Byte
The red color component, in range of 0-255.
data_object
Properties
6
Hex
string
String representation of the form "#RRGGBB[AA]".
RawInt
UInt32
Integer representation of the form 0xAABBGGRR as used by native code.
Rgb
string
String representation in the form of
rgb
( r, g, b ) css function notation.
Rgba
string
String representation in the form of
rgba
( r, g, b, a ) css function notation.
RgbaInt
UInt32
Integer representation of the form 0xRRGGBBAA.
RgbInt
UInt32
Integer representation of the form 0xRRGGBB.
functions
Methods
3
LerpTo
(
target
,
frac
)
Color32
Performs linear interpolation between this and given colors.
ToColor
(
)
Color
Convert this object to Color.
Write
(
writer
)
Write this color to a binary writer.
data_object
Static Properties
3
Black
Color32
A constant representing a fully opaque color black.
Transparent
Color32
A constant representing a fully transparent color.
White
Color32
A constant representing a fully opaque color white.
functions
Static Methods
7
FromRgb
(
rgb
)
Color32
Converts an integer of the form 0xRRGGBB into the color #RRGGBB with 100% alpha.
FromRgba
(
rgba
)
Color32
Converts an integer of the form 0xRRGGBBAA into the color #RRGGBBAA.
Lerp
(
a
,
b
,
frac
)
Color32
Performs linear interpolation between two colors.
Max
(
a
,
b
)
Color32
Returns a new color with each component being the maximum of the 2 given colors.
Min
(
a
,
b
)
Color32
Returns a new color with each component being the minimum of the 2 given colors.
Parse
(
value
)
Nullable`1
Parse a string to a color, in format "255 255 255 255" or "255,255,255". Alpha is optional.
Read
(
reader
)
Color32
Read a color from binary reader.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.