raylib/color
color
(color [r :int g :int b :int a :int] :int)
construct a Color from RGBA components (0-255 each).
| r | red channel (0-255) | |
| g | green channel (0-255) | |
| b | blue channel (0-255) | |
| a | alpha channel (0-255) |
Opaque :int handle to a heap-allocated Raylib Color struct.
(color 255 128 0 255) ; => orange
Since: P3
red
(red :int)
Raylib RED color constant (230, 41, 55, 255).
Since: P3
green
(green :int)
Raylib GREEN color constant (0, 228, 48, 255).
Since: P3
blue
(blue :int)
Raylib BLUE color constant (0, 121, 241, 255).
Since: P3
white
(white :int)
Raylib WHITE color constant (255, 255, 255, 255).
Since: P3
black
(black :int)
Raylib BLACK color constant (0, 0, 0, 255).
Since: P3
gray
(gray :int)
Raylib GRAY color constant (130, 130, 130, 255).
Since: P3
yellow
(yellow :int)
Raylib YELLOW color constant (253, 249, 0, 255).
Since: P3
orange
(orange :int)
Raylib ORANGE color constant (255, 161, 0, 255).
Since: P3
purple
(purple :int)
Raylib PURPLE color constant (200, 122, 255, 255).
Since: P3
pink
(pink :int)
Raylib PINK color constant (255, 109, 194, 255).
Since: P3
skyblue
(skyblue :int)
Raylib SKYBLUE color constant (102, 191, 255, 255).
Since: P3
raywhite
(raywhite :int)
Raylib RAYWHITE color constant (245, 245, 245, 255).
Since: P3
fade
(fade [col :int alpha :float] :int)
return a copy of a color with its alpha multiplied by the given factor.
| col | Color handle to fade | |
| alpha | opacity factor in [0.0, 1.0] |
A new heap-allocated Color handle with adjusted alpha.
(fade (red) 0.5) ; => semi-transparent red
Since: P3
color-lerp
(color-lerp [c1 :int c2 :int t :float] :int)
linearly interpolate between two colors.
| c1 | start Color handle | |
| c2 | end Color handle | |
| t | interpolation factor in [0.0, 1.0] |
A new heap-allocated Color handle with interpolated RGBA values.
(color-lerp (red) (blue) 0.5) ; => purple-ish
Since: P3