🦀 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/sweetie-16
set_color(Color::from(1), RGB::new(0x1a, 0x1c, 0x2c));
set_color(Color::from(2), RGB::new(0x5d, 0x27, 0x5d));
set_color(Color::from(3), RGB::new(0xb1, 0x3e, 0x53));
set_color(Color::from(4), RGB::new(0xef, 0x7d, 0x57));
set_color(Color::from(5), RGB::new(0xff, 0xcd, 0x75));
set_color(Color::from(6), RGB::new(0xa7, 0xf0, 0x70));
set_color(Color::from(7), RGB::new(0x38, 0xb7, 0x64));
set_color(Color::from(8), RGB::new(0x25, 0x71, 0x79));
set_color(Color::from(9), RGB::new(0x29, 0x36, 0x6f));
set_color(Color::from(10), RGB::new(0x3b, 0x5d, 0xc9));
set_color(Color::from(11), RGB::new(0x41, 0xa6, 0xf6));
set_color(Color::from(12), RGB::new(0x73, 0xef, 0xf7));
set_color(Color::from(13), RGB::new(0xf4, 0xf4, 0xf4));
set_color(Color::from(14), RGB::new(0x94, 0xb0, 0xc2));
set_color(Color::from(15), RGB::new(0x56, 0x6c, 0x86));
set_color(Color::from(16), RGB::new(0x33, 0x3c, 0x57));
}
🏃 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/sweetie-16
firefly.SetColor(1, firefly.RGB{R: 0x1a, G: 0x1c, B: 0x2c})
firefly.SetColor(2, firefly.RGB{R: 0x5d, G: 0x27, B: 0x5d})
firefly.SetColor(3, firefly.RGB{R: 0xb1, G: 0x3e, B: 0x53})
firefly.SetColor(4, firefly.RGB{R: 0xef, G: 0x7d, B: 0x57})
firefly.SetColor(5, firefly.RGB{R: 0xff, G: 0xcd, B: 0x75})
firefly.SetColor(6, firefly.RGB{R: 0xa7, G: 0xf0, B: 0x70})
firefly.SetColor(7, firefly.RGB{R: 0x38, G: 0xb7, B: 0x64})
firefly.SetColor(8, firefly.RGB{R: 0x25, G: 0x71, B: 0x79})
firefly.SetColor(9, firefly.RGB{R: 0x29, G: 0x36, B: 0x6f})
firefly.SetColor(10, firefly.RGB{R: 0x3b, G: 0x5d, B: 0xc9})
firefly.SetColor(11, firefly.RGB{R: 0x41, G: 0xa6, B: 0xf6})
firefly.SetColor(12, firefly.RGB{R: 0x73, G: 0xef, B: 0xf7})
firefly.SetColor(13, firefly.RGB{R: 0xf4, G: 0xf4, B: 0xf4})
firefly.SetColor(14, firefly.RGB{R: 0x94, G: 0xb0, B: 0xc2})
firefly.SetColor(15, firefly.RGB{R: 0x56, G: 0x6c, B: 0x86})
firefly.SetColor(16, firefly.RGB{R: 0x33, G: 0x3c, B: 0x57})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/sweetie-16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0x1a, .g = 0x1c, .b = 0x2c});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x5d, .g = 0x27, .b = 0x5d});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0xb1, .g = 0x3e, .b = 0x53});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0xef, .g = 0x7d, .b = 0x57});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0xff, .g = 0xcd, .b = 0x75});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0xa7, .g = 0xf0, .b = 0x70});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0x38, .g = 0xb7, .b = 0x64});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0x25, .g = 0x71, .b = 0x79});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x29, .g = 0x36, .b = 0x6f});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x3b, .g = 0x5d, .b = 0xc9});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0x41, .g = 0xa6, .b = 0xf6});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x73, .g = 0xef, .b = 0xf7});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xf4, .g = 0xf4, .b = 0xf4});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0x94, .g = 0xb0, .b = 0xc2});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0x56, .g = 0x6c, .b = 0x86});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x33, .g = 0x3c, .b = 0x57});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/sweetie-16
RGB color1 = {0x1a, 0x1c, 0x2c};
set_color(1, color1);
RGB color2 = {0x5d, 0x27, 0x5d};
set_color(2, color2);
RGB color3 = {0xb1, 0x3e, 0x53};
set_color(3, color3);
RGB color4 = {0xef, 0x7d, 0x57};
set_color(4, color4);
RGB color5 = {0xff, 0xcd, 0x75};
set_color(5, color5);
RGB color6 = {0xa7, 0xf0, 0x70};
set_color(6, color6);
RGB color7 = {0x38, 0xb7, 0x64};
set_color(7, color7);
RGB color8 = {0x25, 0x71, 0x79};
set_color(8, color8);
RGB color9 = {0x29, 0x36, 0x6f};
set_color(9, color9);
RGB color10 = {0x3b, 0x5d, 0xc9};
set_color(10, color10);
RGB color11 = {0x41, 0xa6, 0xf6};
set_color(11, color11);
RGB color12 = {0x73, 0xef, 0xf7};
set_color(12, color12);
RGB color13 = {0xf4, 0xf4, 0xf4};
set_color(13, color13);
RGB color14 = {0x94, 0xb0, 0xc2};
set_color(14, color14);
RGB color15 = {0x56, 0x6c, 0x86};
set_color(15, color15);
RGB color16 = {0x33, 0x3c, 0x57};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/sweetie-16
set_color(1, {0x1a, 0x1c, 0x2c});
set_color(2, {0x5d, 0x27, 0x5d});
set_color(3, {0xb1, 0x3e, 0x53});
set_color(4, {0xef, 0x7d, 0x57});
set_color(5, {0xff, 0xcd, 0x75});
set_color(6, {0xa7, 0xf0, 0x70});
set_color(7, {0x38, 0xb7, 0x64});
set_color(8, {0x25, 0x71, 0x79});
set_color(9, {0x29, 0x36, 0x6f});
set_color(10, {0x3b, 0x5d, 0xc9});
set_color(11, {0x41, 0xa6, 0xf6});
set_color(12, {0x73, 0xef, 0xf7});
set_color(13, {0xf4, 0xf4, 0xf4});
set_color(14, {0x94, 0xb0, 0xc2});
set_color(15, {0x56, 0x6c, 0x86});
set_color(16, {0x33, 0x3c, 0x57});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/sweetie-16
@firefly.set_color(Color::from_int(1), RGB::new(0x1a, 0x1c, 0x2c));
@firefly.set_color(Color::from_int(2), RGB::new(0x5d, 0x27, 0x5d));
@firefly.set_color(Color::from_int(3), RGB::new(0xb1, 0x3e, 0x53));
@firefly.set_color(Color::from_int(4), RGB::new(0xef, 0x7d, 0x57));
@firefly.set_color(Color::from_int(5), RGB::new(0xff, 0xcd, 0x75));
@firefly.set_color(Color::from_int(6), RGB::new(0xa7, 0xf0, 0x70));
@firefly.set_color(Color::from_int(7), RGB::new(0x38, 0xb7, 0x64));
@firefly.set_color(Color::from_int(8), RGB::new(0x25, 0x71, 0x79));
@firefly.set_color(Color::from_int(9), RGB::new(0x29, 0x36, 0x6f));
@firefly.set_color(Color::from_int(10), RGB::new(0x3b, 0x5d, 0xc9));
@firefly.set_color(Color::from_int(11), RGB::new(0x41, 0xa6, 0xf6));
@firefly.set_color(Color::from_int(12), RGB::new(0x73, 0xef, 0xf7));
@firefly.set_color(Color::from_int(13), RGB::new(0xf4, 0xf4, 0xf4));
@firefly.set_color(Color::from_int(14), RGB::new(0x94, 0xb0, 0xc2));
@firefly.set_color(Color::from_int(15), RGB::new(0x56, 0x6c, 0x86));
@firefly.set_color(Color::from_int(16), RGB::new(0x33, 0x3c, 0x57));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/sweetie-16
firefly.set_color(1, {r=0x1a, g=0x1c, b=0x2c});
firefly.set_color(2, {r=0x5d, g=0x27, b=0x5d});
firefly.set_color(3, {r=0xb1, g=0x3e, b=0x53});
firefly.set_color(4, {r=0xef, g=0x7d, b=0x57});
firefly.set_color(5, {r=0xff, g=0xcd, b=0x75});
firefly.set_color(6, {r=0xa7, g=0xf0, b=0x70});
firefly.set_color(7, {r=0x38, g=0xb7, b=0x64});
firefly.set_color(8, {r=0x25, g=0x71, b=0x79});
firefly.set_color(9, {r=0x29, g=0x36, b=0x6f});
firefly.set_color(10, {r=0x3b, g=0x5d, b=0xc9});
firefly.set_color(11, {r=0x41, g=0xa6, b=0xf6});
firefly.set_color(12, {r=0x73, g=0xef, b=0xf7});
firefly.set_color(13, {r=0xf4, g=0xf4, b=0xf4});
firefly.set_color(14, {r=0x94, g=0xb0, b=0xc2});
firefly.set_color(15, {r=0x56, g=0x6c, b=0x86});
firefly.set_color(16, {r=0x33, g=0x3c, b=0x57});
end