initial commit
This commit is contained in:
commit
0b3af7375e
39 changed files with 2339 additions and 0 deletions
19
test/test_color.c3
Normal file
19
test/test_color.c3
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import std::io;
|
||||
|
||||
struct Color { short r,g,b,a; }
|
||||
|
||||
macro Color uint.to_rgba(uint u)
|
||||
{
|
||||
return Color{
|
||||
.r = (char)((u >> 24) & 0xff),
|
||||
.g = (char)((u >> 16) & 0xff),
|
||||
.b = (char)((u >> 8) & 0xff),
|
||||
.a = (char)((u >> 0) & 0xff)
|
||||
};
|
||||
}
|
||||
|
||||
fn void main(String[] args)
|
||||
{
|
||||
uint col = args[1].to_uint()!!;
|
||||
io::printn(col.to_rgba());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue