Ooops
March 04, 2021, 12:04:28 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Color Functions by N [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Color Functions by N [ 1+ years ago ] (Read 641 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Color Functions by N [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:42 AM »
Title :
Color Functions
Author :
N
Posted :
1+ years ago
Description :
The short description is enough.
Code :
Code: BlitzBasic
Const
RALPHA =
24
;Return Alpha when using RColor
Const
RRED =
16
;Return Red when using RColor
Const
RGREEN =
8
;Return Green when using RColor
Const
RBLUE =
0
;Return Blue when using RColor
; IntColor returns an integer color useable by WritePixel() and WritePixelFast()
; R = Red
; G = Green
; B = Blue
; A = Alpha.
; return = An integer color useable by functions such as WritePixel() and WritePixelFast()
Function
IntColor
(
R,G,B,A=
255
)
Return
A
Shl
24
Or
R
Shl
16
Or
G
Shl
8
Or
B
Shl
0
End Function
; RColor returns the value of Red, Green, Blue, or Alpha in C.
; c = An integer color returned by, for example, ReadPixelFast()
; c = The amount of bits C should be shifted right to. Valid constants are: RRED, RGREEN, RBLUE, RALPHA
; return = An integer ranging from 0 to 255.
Function
RColor%
(
c%,d%
)
Return
c
Shr
d
And
255
Shl
0
End Function
Comments :
Filax(Posted 1+ years ago)
Very usefull thanks !
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Color Functions by N [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal