36 lines
895 B
Text
36 lines
895 B
Text
{
|
||
print-nullterm 'H''e''l''l''o'' ''W''o''r''l''d''!''\n''\0';
|
||
|
||
/* test ratio
|
||
*/
|
||
print-nullterm
|
||
(fmt-ratio { 4; int-neg 3; })
|
||
' ''*'' '
|
||
(fmt-ratio { 7; 4; })
|
||
' ''='' '
|
||
(fmt-ratio (ratio-mul { 4; int-neg 3; } { 7; 4; }))
|
||
'\n''\0';
|
||
|
||
/* Colors
|
||
*/
|
||
let red-u8rgb
|
||
: <Fn <> Color ~ RGB ~ <Vec3 ℝ_0,1 ~ ℤ_256 ~ machine.UInt64>>
|
||
= λ{} ↦ { 0; 0; 255; };
|
||
|
||
let green-u8rgb = λ{} ↦ { 0; 255; 0; };
|
||
let blue-u8rgb = λ{} ↦ { 255; 0; 0; };
|
||
let yellow-u8rgb = λ{} ↦ { 0; 220; 220; };
|
||
|
||
print-nullterm (fmt-vec3i (morph-rgb-to-hsv yellow-u8rgb)) '\n''\0';
|
||
|
||
print-nullterm
|
||
(fmt-vec3i green-u8rgb)
|
||
' ''+'' '
|
||
(fmt-vec3i blue-u8rgb)
|
||
' ''='' '
|
||
(fmt-vec3i (vec3i-add green-u8rgb blue-u8rgb))
|
||
'\n''\0';
|
||
|
||
uint-machine-to-posint 16 256;
|
||
}
|
||
|