🦀 Rust
#![no_std]
#![no_main]
use firefly_rust::*;
#[unsafe(no_mangle)]
extern "C" fn boot() {
set_colors();
}
fn set_colors() {
// https://lospec.com/palette-list/arq16
set_color(Color::from(1), RGB::new(0xff, 0xff, 0xff));
set_color(Color::from(2), RGB::new(0xff, 0xd1, 0x9d));
set_color(Color::from(3), RGB::new(0xae, 0xb5, 0xbd));
set_color(Color::from(4), RGB::new(0x4d, 0x80, 0xc9));
set_color(Color::from(5), RGB::new(0xe9, 0x38, 0x41));
set_color(Color::from(6), RGB::new(0x10, 0x08, 0x20));
set_color(Color::from(7), RGB::new(0x51, 0x1e, 0x43));
set_color(Color::from(8), RGB::new(0x05, 0x44, 0x94));
set_color(Color::from(9), RGB::new(0xf1, 0x89, 0x2d));
set_color(Color::from(10), RGB::new(0x82, 0x3e, 0x2c));
set_color(Color::from(11), RGB::new(0xff, 0xa9, 0xa9));
set_color(Color::from(12), RGB::new(0x5a, 0xe1, 0x50));
set_color(Color::from(13), RGB::new(0xff, 0xe9, 0x47));
set_color(Color::from(14), RGB::new(0x7d, 0x3e, 0xbf));
set_color(Color::from(15), RGB::new(0xeb, 0x6c, 0x82));
set_color(Color::from(16), RGB::new(0x1e, 0x8a, 0x4c));
}
🏃 Go
package main
import "github.com/firefly-zero/firefly-go/firefly"
func init() {
firefly.Boot = boot
}
func boot() {
setColors()
}
func setColors() {
// https://lospec.com/palette-list/arq16
firefly.SetColor(1, firefly.RGB{R: 0xff, G: 0xff, B: 0xff})
firefly.SetColor(2, firefly.RGB{R: 0xff, G: 0xd1, B: 0x9d})
firefly.SetColor(3, firefly.RGB{R: 0xae, G: 0xb5, B: 0xbd})
firefly.SetColor(4, firefly.RGB{R: 0x4d, G: 0x80, B: 0xc9})
firefly.SetColor(5, firefly.RGB{R: 0xe9, G: 0x38, B: 0x41})
firefly.SetColor(6, firefly.RGB{R: 0x10, G: 0x08, B: 0x20})
firefly.SetColor(7, firefly.RGB{R: 0x51, G: 0x1e, B: 0x43})
firefly.SetColor(8, firefly.RGB{R: 0x05, G: 0x44, B: 0x94})
firefly.SetColor(9, firefly.RGB{R: 0xf1, G: 0x89, B: 0x2d})
firefly.SetColor(10, firefly.RGB{R: 0x82, G: 0x3e, B: 0x2c})
firefly.SetColor(11, firefly.RGB{R: 0xff, G: 0xa9, B: 0xa9})
firefly.SetColor(12, firefly.RGB{R: 0x5a, G: 0xe1, B: 0x50})
firefly.SetColor(13, firefly.RGB{R: 0xff, G: 0xe9, B: 0x47})
firefly.SetColor(14, firefly.RGB{R: 0x7d, G: 0x3e, B: 0xbf})
firefly.SetColor(15, firefly.RGB{R: 0xeb, G: 0x6c, B: 0x82})
firefly.SetColor(16, firefly.RGB{R: 0x1e, G: 0x8a, B: 0x4c})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/arq16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0xff, .g = 0xff, .b = 0xff});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0xff, .g = 0xd1, .b = 0x9d});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0xae, .g = 0xb5, .b = 0xbd});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0x4d, .g = 0x80, .b = 0xc9});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0xe9, .g = 0x38, .b = 0x41});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0x10, .g = 0x08, .b = 0x20});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0x51, .g = 0x1e, .b = 0x43});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0x05, .g = 0x44, .b = 0x94});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0xf1, .g = 0x89, .b = 0x2d});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x82, .g = 0x3e, .b = 0x2c});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0xff, .g = 0xa9, .b = 0xa9});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x5a, .g = 0xe1, .b = 0x50});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xff, .g = 0xe9, .b = 0x47});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0x7d, .g = 0x3e, .b = 0xbf});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xeb, .g = 0x6c, .b = 0x82});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x1e, .g = 0x8a, .b = 0x4c});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/arq16
RGB color1 = {0xff, 0xff, 0xff};
set_color(1, color1);
RGB color2 = {0xff, 0xd1, 0x9d};
set_color(2, color2);
RGB color3 = {0xae, 0xb5, 0xbd};
set_color(3, color3);
RGB color4 = {0x4d, 0x80, 0xc9};
set_color(4, color4);
RGB color5 = {0xe9, 0x38, 0x41};
set_color(5, color5);
RGB color6 = {0x10, 0x08, 0x20};
set_color(6, color6);
RGB color7 = {0x51, 0x1e, 0x43};
set_color(7, color7);
RGB color8 = {0x05, 0x44, 0x94};
set_color(8, color8);
RGB color9 = {0xf1, 0x89, 0x2d};
set_color(9, color9);
RGB color10 = {0x82, 0x3e, 0x2c};
set_color(10, color10);
RGB color11 = {0xff, 0xa9, 0xa9};
set_color(11, color11);
RGB color12 = {0x5a, 0xe1, 0x50};
set_color(12, color12);
RGB color13 = {0xff, 0xe9, 0x47};
set_color(13, color13);
RGB color14 = {0x7d, 0x3e, 0xbf};
set_color(14, color14);
RGB color15 = {0xeb, 0x6c, 0x82};
set_color(15, color15);
RGB color16 = {0x1e, 0x8a, 0x4c};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/arq16
set_color(1, {0xff, 0xff, 0xff});
set_color(2, {0xff, 0xd1, 0x9d});
set_color(3, {0xae, 0xb5, 0xbd});
set_color(4, {0x4d, 0x80, 0xc9});
set_color(5, {0xe9, 0x38, 0x41});
set_color(6, {0x10, 0x08, 0x20});
set_color(7, {0x51, 0x1e, 0x43});
set_color(8, {0x05, 0x44, 0x94});
set_color(9, {0xf1, 0x89, 0x2d});
set_color(10, {0x82, 0x3e, 0x2c});
set_color(11, {0xff, 0xa9, 0xa9});
set_color(12, {0x5a, 0xe1, 0x50});
set_color(13, {0xff, 0xe9, 0x47});
set_color(14, {0x7d, 0x3e, 0xbf});
set_color(15, {0xeb, 0x6c, 0x82});
set_color(16, {0x1e, 0x8a, 0x4c});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/arq16
@firefly.set_color(Color::from_int(1), RGB::new(0xff, 0xff, 0xff));
@firefly.set_color(Color::from_int(2), RGB::new(0xff, 0xd1, 0x9d));
@firefly.set_color(Color::from_int(3), RGB::new(0xae, 0xb5, 0xbd));
@firefly.set_color(Color::from_int(4), RGB::new(0x4d, 0x80, 0xc9));
@firefly.set_color(Color::from_int(5), RGB::new(0xe9, 0x38, 0x41));
@firefly.set_color(Color::from_int(6), RGB::new(0x10, 0x08, 0x20));
@firefly.set_color(Color::from_int(7), RGB::new(0x51, 0x1e, 0x43));
@firefly.set_color(Color::from_int(8), RGB::new(0x05, 0x44, 0x94));
@firefly.set_color(Color::from_int(9), RGB::new(0xf1, 0x89, 0x2d));
@firefly.set_color(Color::from_int(10), RGB::new(0x82, 0x3e, 0x2c));
@firefly.set_color(Color::from_int(11), RGB::new(0xff, 0xa9, 0xa9));
@firefly.set_color(Color::from_int(12), RGB::new(0x5a, 0xe1, 0x50));
@firefly.set_color(Color::from_int(13), RGB::new(0xff, 0xe9, 0x47));
@firefly.set_color(Color::from_int(14), RGB::new(0x7d, 0x3e, 0xbf));
@firefly.set_color(Color::from_int(15), RGB::new(0xeb, 0x6c, 0x82));
@firefly.set_color(Color::from_int(16), RGB::new(0x1e, 0x8a, 0x4c));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/arq16
firefly.set_color(1, {r=0xff, g=0xff, b=0xff});
firefly.set_color(2, {r=0xff, g=0xd1, b=0x9d});
firefly.set_color(3, {r=0xae, g=0xb5, b=0xbd});
firefly.set_color(4, {r=0x4d, g=0x80, b=0xc9});
firefly.set_color(5, {r=0xe9, g=0x38, b=0x41});
firefly.set_color(6, {r=0x10, g=0x08, b=0x20});
firefly.set_color(7, {r=0x51, g=0x1e, b=0x43});
firefly.set_color(8, {r=0x05, g=0x44, b=0x94});
firefly.set_color(9, {r=0xf1, g=0x89, b=0x2d});
firefly.set_color(10, {r=0x82, g=0x3e, b=0x2c});
firefly.set_color(11, {r=0xff, g=0xa9, b=0xa9});
firefly.set_color(12, {r=0x5a, g=0xe1, b=0x50});
firefly.set_color(13, {r=0xff, g=0xe9, b=0x47});
firefly.set_color(14, {r=0x7d, g=0x3e, b=0xbf});
firefly.set_color(15, {r=0xeb, g=0x6c, b=0x82});
firefly.set_color(16, {r=0x1e, g=0x8a, b=0x4c});
end