🦀 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/na16
set_color(Color::from(1), RGB::new(0x8c, 0x8f, 0xae));
set_color(Color::from(2), RGB::new(0x58, 0x45, 0x63));
set_color(Color::from(3), RGB::new(0x3e, 0x21, 0x37));
set_color(Color::from(4), RGB::new(0x9a, 0x63, 0x48));
set_color(Color::from(5), RGB::new(0xd7, 0x9b, 0x7d));
set_color(Color::from(6), RGB::new(0xf5, 0xed, 0xba));
set_color(Color::from(7), RGB::new(0xc0, 0xc7, 0x41));
set_color(Color::from(8), RGB::new(0x64, 0x7d, 0x34));
set_color(Color::from(9), RGB::new(0xe4, 0x94, 0x3a));
set_color(Color::from(10), RGB::new(0x9d, 0x30, 0x3b));
set_color(Color::from(11), RGB::new(0xd2, 0x64, 0x71));
set_color(Color::from(12), RGB::new(0x70, 0x37, 0x7f));
set_color(Color::from(13), RGB::new(0x7e, 0xc4, 0xc1));
set_color(Color::from(14), RGB::new(0x34, 0x85, 0x9d));
set_color(Color::from(15), RGB::new(0x17, 0x43, 0x4b));
set_color(Color::from(16), RGB::new(0x1f, 0x0e, 0x1c));
}
🏃 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/na16
firefly.SetColor(1, firefly.RGB{R: 0x8c, G: 0x8f, B: 0xae})
firefly.SetColor(2, firefly.RGB{R: 0x58, G: 0x45, B: 0x63})
firefly.SetColor(3, firefly.RGB{R: 0x3e, G: 0x21, B: 0x37})
firefly.SetColor(4, firefly.RGB{R: 0x9a, G: 0x63, B: 0x48})
firefly.SetColor(5, firefly.RGB{R: 0xd7, G: 0x9b, B: 0x7d})
firefly.SetColor(6, firefly.RGB{R: 0xf5, G: 0xed, B: 0xba})
firefly.SetColor(7, firefly.RGB{R: 0xc0, G: 0xc7, B: 0x41})
firefly.SetColor(8, firefly.RGB{R: 0x64, G: 0x7d, B: 0x34})
firefly.SetColor(9, firefly.RGB{R: 0xe4, G: 0x94, B: 0x3a})
firefly.SetColor(10, firefly.RGB{R: 0x9d, G: 0x30, B: 0x3b})
firefly.SetColor(11, firefly.RGB{R: 0xd2, G: 0x64, B: 0x71})
firefly.SetColor(12, firefly.RGB{R: 0x70, G: 0x37, B: 0x7f})
firefly.SetColor(13, firefly.RGB{R: 0x7e, G: 0xc4, B: 0xc1})
firefly.SetColor(14, firefly.RGB{R: 0x34, G: 0x85, B: 0x9d})
firefly.SetColor(15, firefly.RGB{R: 0x17, G: 0x43, B: 0x4b})
firefly.SetColor(16, firefly.RGB{R: 0x1f, G: 0x0e, B: 0x1c})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/na16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0x8c, .g = 0x8f, .b = 0xae});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x58, .g = 0x45, .b = 0x63});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0x3e, .g = 0x21, .b = 0x37});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0x9a, .g = 0x63, .b = 0x48});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0xd7, .g = 0x9b, .b = 0x7d});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0xf5, .g = 0xed, .b = 0xba});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0xc0, .g = 0xc7, .b = 0x41});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0x64, .g = 0x7d, .b = 0x34});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0xe4, .g = 0x94, .b = 0x3a});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x9d, .g = 0x30, .b = 0x3b});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0xd2, .g = 0x64, .b = 0x71});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x70, .g = 0x37, .b = 0x7f});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0x7e, .g = 0xc4, .b = 0xc1});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0x34, .g = 0x85, .b = 0x9d});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0x17, .g = 0x43, .b = 0x4b});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x1f, .g = 0x0e, .b = 0x1c});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/na16
RGB color1 = {0x8c, 0x8f, 0xae};
set_color(1, color1);
RGB color2 = {0x58, 0x45, 0x63};
set_color(2, color2);
RGB color3 = {0x3e, 0x21, 0x37};
set_color(3, color3);
RGB color4 = {0x9a, 0x63, 0x48};
set_color(4, color4);
RGB color5 = {0xd7, 0x9b, 0x7d};
set_color(5, color5);
RGB color6 = {0xf5, 0xed, 0xba};
set_color(6, color6);
RGB color7 = {0xc0, 0xc7, 0x41};
set_color(7, color7);
RGB color8 = {0x64, 0x7d, 0x34};
set_color(8, color8);
RGB color9 = {0xe4, 0x94, 0x3a};
set_color(9, color9);
RGB color10 = {0x9d, 0x30, 0x3b};
set_color(10, color10);
RGB color11 = {0xd2, 0x64, 0x71};
set_color(11, color11);
RGB color12 = {0x70, 0x37, 0x7f};
set_color(12, color12);
RGB color13 = {0x7e, 0xc4, 0xc1};
set_color(13, color13);
RGB color14 = {0x34, 0x85, 0x9d};
set_color(14, color14);
RGB color15 = {0x17, 0x43, 0x4b};
set_color(15, color15);
RGB color16 = {0x1f, 0x0e, 0x1c};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/na16
set_color(1, {0x8c, 0x8f, 0xae});
set_color(2, {0x58, 0x45, 0x63});
set_color(3, {0x3e, 0x21, 0x37});
set_color(4, {0x9a, 0x63, 0x48});
set_color(5, {0xd7, 0x9b, 0x7d});
set_color(6, {0xf5, 0xed, 0xba});
set_color(7, {0xc0, 0xc7, 0x41});
set_color(8, {0x64, 0x7d, 0x34});
set_color(9, {0xe4, 0x94, 0x3a});
set_color(10, {0x9d, 0x30, 0x3b});
set_color(11, {0xd2, 0x64, 0x71});
set_color(12, {0x70, 0x37, 0x7f});
set_color(13, {0x7e, 0xc4, 0xc1});
set_color(14, {0x34, 0x85, 0x9d});
set_color(15, {0x17, 0x43, 0x4b});
set_color(16, {0x1f, 0x0e, 0x1c});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/na16
@firefly.set_color(Color::from_int(1), RGB::new(0x8c, 0x8f, 0xae));
@firefly.set_color(Color::from_int(2), RGB::new(0x58, 0x45, 0x63));
@firefly.set_color(Color::from_int(3), RGB::new(0x3e, 0x21, 0x37));
@firefly.set_color(Color::from_int(4), RGB::new(0x9a, 0x63, 0x48));
@firefly.set_color(Color::from_int(5), RGB::new(0xd7, 0x9b, 0x7d));
@firefly.set_color(Color::from_int(6), RGB::new(0xf5, 0xed, 0xba));
@firefly.set_color(Color::from_int(7), RGB::new(0xc0, 0xc7, 0x41));
@firefly.set_color(Color::from_int(8), RGB::new(0x64, 0x7d, 0x34));
@firefly.set_color(Color::from_int(9), RGB::new(0xe4, 0x94, 0x3a));
@firefly.set_color(Color::from_int(10), RGB::new(0x9d, 0x30, 0x3b));
@firefly.set_color(Color::from_int(11), RGB::new(0xd2, 0x64, 0x71));
@firefly.set_color(Color::from_int(12), RGB::new(0x70, 0x37, 0x7f));
@firefly.set_color(Color::from_int(13), RGB::new(0x7e, 0xc4, 0xc1));
@firefly.set_color(Color::from_int(14), RGB::new(0x34, 0x85, 0x9d));
@firefly.set_color(Color::from_int(15), RGB::new(0x17, 0x43, 0x4b));
@firefly.set_color(Color::from_int(16), RGB::new(0x1f, 0x0e, 0x1c));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/na16
firefly.set_color(1, {r=0x8c, g=0x8f, b=0xae});
firefly.set_color(2, {r=0x58, g=0x45, b=0x63});
firefly.set_color(3, {r=0x3e, g=0x21, b=0x37});
firefly.set_color(4, {r=0x9a, g=0x63, b=0x48});
firefly.set_color(5, {r=0xd7, g=0x9b, b=0x7d});
firefly.set_color(6, {r=0xf5, g=0xed, b=0xba});
firefly.set_color(7, {r=0xc0, g=0xc7, b=0x41});
firefly.set_color(8, {r=0x64, g=0x7d, b=0x34});
firefly.set_color(9, {r=0xe4, g=0x94, b=0x3a});
firefly.set_color(10, {r=0x9d, g=0x30, b=0x3b});
firefly.set_color(11, {r=0xd2, g=0x64, b=0x71});
firefly.set_color(12, {r=0x70, g=0x37, b=0x7f});
firefly.set_color(13, {r=0x7e, g=0xc4, b=0xc1});
firefly.set_color(14, {r=0x34, g=0x85, b=0x9d});
firefly.set_color(15, {r=0x17, g=0x43, b=0x4b});
firefly.set_color(16, {r=0x1f, g=0x0e, b=0x1c});
end