🦀 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/endesga-16
set_color(Color::from(1), RGB::new(0xe4, 0xa6, 0x72));
set_color(Color::from(2), RGB::new(0xb8, 0x6f, 0x50));
set_color(Color::from(3), RGB::new(0x74, 0x3f, 0x39));
set_color(Color::from(4), RGB::new(0x3f, 0x28, 0x32));
set_color(Color::from(5), RGB::new(0x9e, 0x28, 0x35));
set_color(Color::from(6), RGB::new(0xe5, 0x3b, 0x44));
set_color(Color::from(7), RGB::new(0xfb, 0x92, 0x2b));
set_color(Color::from(8), RGB::new(0xff, 0xe7, 0x62));
set_color(Color::from(9), RGB::new(0x63, 0xc6, 0x4d));
set_color(Color::from(10), RGB::new(0x32, 0x73, 0x45));
set_color(Color::from(11), RGB::new(0x19, 0x3d, 0x3f));
set_color(Color::from(12), RGB::new(0x4f, 0x67, 0x81));
set_color(Color::from(13), RGB::new(0xaf, 0xbf, 0xd2));
set_color(Color::from(14), RGB::new(0xff, 0xff, 0xff));
set_color(Color::from(15), RGB::new(0x2c, 0xe8, 0xf4));
set_color(Color::from(16), RGB::new(0x04, 0x84, 0xd1));
}
🏃 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/endesga-16
firefly.SetColor(1, firefly.RGB{R: 0xe4, G: 0xa6, B: 0x72})
firefly.SetColor(2, firefly.RGB{R: 0xb8, G: 0x6f, B: 0x50})
firefly.SetColor(3, firefly.RGB{R: 0x74, G: 0x3f, B: 0x39})
firefly.SetColor(4, firefly.RGB{R: 0x3f, G: 0x28, B: 0x32})
firefly.SetColor(5, firefly.RGB{R: 0x9e, G: 0x28, B: 0x35})
firefly.SetColor(6, firefly.RGB{R: 0xe5, G: 0x3b, B: 0x44})
firefly.SetColor(7, firefly.RGB{R: 0xfb, G: 0x92, B: 0x2b})
firefly.SetColor(8, firefly.RGB{R: 0xff, G: 0xe7, B: 0x62})
firefly.SetColor(9, firefly.RGB{R: 0x63, G: 0xc6, B: 0x4d})
firefly.SetColor(10, firefly.RGB{R: 0x32, G: 0x73, B: 0x45})
firefly.SetColor(11, firefly.RGB{R: 0x19, G: 0x3d, B: 0x3f})
firefly.SetColor(12, firefly.RGB{R: 0x4f, G: 0x67, B: 0x81})
firefly.SetColor(13, firefly.RGB{R: 0xaf, G: 0xbf, B: 0xd2})
firefly.SetColor(14, firefly.RGB{R: 0xff, G: 0xff, B: 0xff})
firefly.SetColor(15, firefly.RGB{R: 0x2c, G: 0xe8, B: 0xf4})
firefly.SetColor(16, firefly.RGB{R: 0x04, G: 0x84, B: 0xd1})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/endesga-16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0xe4, .g = 0xa6, .b = 0x72});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0xb8, .g = 0x6f, .b = 0x50});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0x74, .g = 0x3f, .b = 0x39});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0x3f, .g = 0x28, .b = 0x32});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0x9e, .g = 0x28, .b = 0x35});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0xe5, .g = 0x3b, .b = 0x44});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0xfb, .g = 0x92, .b = 0x2b});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0xff, .g = 0xe7, .b = 0x62});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x63, .g = 0xc6, .b = 0x4d});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x32, .g = 0x73, .b = 0x45});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0x19, .g = 0x3d, .b = 0x3f});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x4f, .g = 0x67, .b = 0x81});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xaf, .g = 0xbf, .b = 0xd2});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0xff, .g = 0xff, .b = 0xff});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0x2c, .g = 0xe8, .b = 0xf4});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x04, .g = 0x84, .b = 0xd1});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/endesga-16
RGB color1 = {0xe4, 0xa6, 0x72};
set_color(1, color1);
RGB color2 = {0xb8, 0x6f, 0x50};
set_color(2, color2);
RGB color3 = {0x74, 0x3f, 0x39};
set_color(3, color3);
RGB color4 = {0x3f, 0x28, 0x32};
set_color(4, color4);
RGB color5 = {0x9e, 0x28, 0x35};
set_color(5, color5);
RGB color6 = {0xe5, 0x3b, 0x44};
set_color(6, color6);
RGB color7 = {0xfb, 0x92, 0x2b};
set_color(7, color7);
RGB color8 = {0xff, 0xe7, 0x62};
set_color(8, color8);
RGB color9 = {0x63, 0xc6, 0x4d};
set_color(9, color9);
RGB color10 = {0x32, 0x73, 0x45};
set_color(10, color10);
RGB color11 = {0x19, 0x3d, 0x3f};
set_color(11, color11);
RGB color12 = {0x4f, 0x67, 0x81};
set_color(12, color12);
RGB color13 = {0xaf, 0xbf, 0xd2};
set_color(13, color13);
RGB color14 = {0xff, 0xff, 0xff};
set_color(14, color14);
RGB color15 = {0x2c, 0xe8, 0xf4};
set_color(15, color15);
RGB color16 = {0x04, 0x84, 0xd1};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/endesga-16
set_color(1, {0xe4, 0xa6, 0x72});
set_color(2, {0xb8, 0x6f, 0x50});
set_color(3, {0x74, 0x3f, 0x39});
set_color(4, {0x3f, 0x28, 0x32});
set_color(5, {0x9e, 0x28, 0x35});
set_color(6, {0xe5, 0x3b, 0x44});
set_color(7, {0xfb, 0x92, 0x2b});
set_color(8, {0xff, 0xe7, 0x62});
set_color(9, {0x63, 0xc6, 0x4d});
set_color(10, {0x32, 0x73, 0x45});
set_color(11, {0x19, 0x3d, 0x3f});
set_color(12, {0x4f, 0x67, 0x81});
set_color(13, {0xaf, 0xbf, 0xd2});
set_color(14, {0xff, 0xff, 0xff});
set_color(15, {0x2c, 0xe8, 0xf4});
set_color(16, {0x04, 0x84, 0xd1});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/endesga-16
@firefly.set_color(Color::from_int(1), RGB::new(0xe4, 0xa6, 0x72));
@firefly.set_color(Color::from_int(2), RGB::new(0xb8, 0x6f, 0x50));
@firefly.set_color(Color::from_int(3), RGB::new(0x74, 0x3f, 0x39));
@firefly.set_color(Color::from_int(4), RGB::new(0x3f, 0x28, 0x32));
@firefly.set_color(Color::from_int(5), RGB::new(0x9e, 0x28, 0x35));
@firefly.set_color(Color::from_int(6), RGB::new(0xe5, 0x3b, 0x44));
@firefly.set_color(Color::from_int(7), RGB::new(0xfb, 0x92, 0x2b));
@firefly.set_color(Color::from_int(8), RGB::new(0xff, 0xe7, 0x62));
@firefly.set_color(Color::from_int(9), RGB::new(0x63, 0xc6, 0x4d));
@firefly.set_color(Color::from_int(10), RGB::new(0x32, 0x73, 0x45));
@firefly.set_color(Color::from_int(11), RGB::new(0x19, 0x3d, 0x3f));
@firefly.set_color(Color::from_int(12), RGB::new(0x4f, 0x67, 0x81));
@firefly.set_color(Color::from_int(13), RGB::new(0xaf, 0xbf, 0xd2));
@firefly.set_color(Color::from_int(14), RGB::new(0xff, 0xff, 0xff));
@firefly.set_color(Color::from_int(15), RGB::new(0x2c, 0xe8, 0xf4));
@firefly.set_color(Color::from_int(16), RGB::new(0x04, 0x84, 0xd1));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/endesga-16
firefly.set_color(1, {r=0xe4, g=0xa6, b=0x72});
firefly.set_color(2, {r=0xb8, g=0x6f, b=0x50});
firefly.set_color(3, {r=0x74, g=0x3f, b=0x39});
firefly.set_color(4, {r=0x3f, g=0x28, b=0x32});
firefly.set_color(5, {r=0x9e, g=0x28, b=0x35});
firefly.set_color(6, {r=0xe5, g=0x3b, b=0x44});
firefly.set_color(7, {r=0xfb, g=0x92, b=0x2b});
firefly.set_color(8, {r=0xff, g=0xe7, b=0x62});
firefly.set_color(9, {r=0x63, g=0xc6, b=0x4d});
firefly.set_color(10, {r=0x32, g=0x73, b=0x45});
firefly.set_color(11, {r=0x19, g=0x3d, b=0x3f});
firefly.set_color(12, {r=0x4f, g=0x67, b=0x81});
firefly.set_color(13, {r=0xaf, g=0xbf, b=0xd2});
firefly.set_color(14, {r=0xff, g=0xff, b=0xff});
firefly.set_color(15, {r=0x2c, g=0xe8, b=0xf4});
firefly.set_color(16, {r=0x04, g=0x84, b=0xd1});
end