[↑]
SmileBASIC4 Replica Reference
RGB
1. Calculate color code from RGB values

RGB(R,G,B)
RGB(A,R,G,B)

Arguments

A

Transparency: 0 to 255
・255 is the default.

R,G,B

Color elements: R, G, B each 0 to 255

・Color examples

Black RGB(0,0,0)
White RGB(255,255,255)
Light Gray RGB(224,224,224)
Gray RGB(128,128,128)
Dark Gray RGB(64,64,64)
Red RGB(255,0,0)
Pink RGB(255,96,208)
Purple RGB(160,32,255)
Light Blue RGB(80,208,255)
Blue RGB(0,32,255)
Yellow Green RGB(96,255,128)
Green RGB(0,192,0)
Yellow RGB(255,224,32)
Orange RGB(255,160,16)
Brown RGB(160,128,96)
Light Red RGB(255,208,160)

Return Value

Color code calculated from the argument

Example

C1=RGB(0,100,200)
C2=RGB(128,0,100,200)
2. Replace each component of the color code

RGB(ColorCode,[A],[R],[G],[B])

Arguments

ColorCode

Replacement source color code

A,R,G,B

Replace color component
・Specify a value between 0 and 255.
・If each one is not specified, the corresponding component of the replacement source color code is used as it is.

Return Value

Color code calculated from the argument

Example

C1=RGB(#C_RED, 127,,,) 'Translucent red
C2=RGB(#C_BLUE,,255,,) 'Purple
3. Get RGB components from color code

RGB ColorCode OUT R,G,B
RGB ColorCode OUT A,R,G,B

Argument

ColorCode

ARGB 8-bit color code

・See GCOLOR for a description of color codes.

Return Value

A

Variable that receives the transparency information of the specified color code

・Returns a value between 0 and 255.

R,G,B

Variable that receives the color component information of the specified color code

・Returns values between 0 and 255 respectively.

Example

RGB C OUT R,G,B
About this site
Our site is an unofficial manual site of programming software "SmileBASIC" for NintendoSwitch™.
I acquire the content of the site from the official reference site of the SmileBoom Co.Ltd. that is the development and sales cause of the software in real time (a minimum period of 24 hours update) and display it. For automatic update, contents may become improper.
Please confirm the correct content in an official site.

June 3, 2020
by mim
OK
|