🦀 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/punolite
set_color(Color::from(1), RGB::new(0x64, 0xc2, 0x24));
set_color(Color::from(2), RGB::new(0x0f, 0xa1, 0x0d));
set_color(Color::from(3), RGB::new(0x09, 0x79, 0x38));
set_color(Color::from(4), RGB::new(0x0b, 0x64, 0x57));
set_color(Color::from(5), RGB::new(0x0a, 0x50, 0x58));
set_color(Color::from(6), RGB::new(0x0a, 0x41, 0x58));
set_color(Color::from(7), RGB::new(0x0a, 0x2e, 0x58));
set_color(Color::from(8), RGB::new(0x09, 0x18, 0x37));
set_color(Color::from(9), RGB::new(0x28, 0x19, 0x61));
set_color(Color::from(10), RGB::new(0x55, 0x20, 0x67));
set_color(Color::from(11), RGB::new(0x70, 0x27, 0x63));
set_color(Color::from(12), RGB::new(0x86, 0x34, 0x53));
set_color(Color::from(13), RGB::new(0xa1, 0x4b, 0x4b));
set_color(Color::from(14), RGB::new(0xb6, 0x7a, 0x5b));
set_color(Color::from(15), RGB::new(0xc8, 0xa2, 0x6e));
set_color(Color::from(16), RGB::new(0xe1, 0xd4, 0x83));
}
🏃 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/punolite
firefly.SetColor(1, firefly.RGB{R: 0x64, G: 0xc2, B: 0x24})
firefly.SetColor(2, firefly.RGB{R: 0x0f, G: 0xa1, B: 0x0d})
firefly.SetColor(3, firefly.RGB{R: 0x09, G: 0x79, B: 0x38})
firefly.SetColor(4, firefly.RGB{R: 0x0b, G: 0x64, B: 0x57})
firefly.SetColor(5, firefly.RGB{R: 0x0a, G: 0x50, B: 0x58})
firefly.SetColor(6, firefly.RGB{R: 0x0a, G: 0x41, B: 0x58})
firefly.SetColor(7, firefly.RGB{R: 0x0a, G: 0x2e, B: 0x58})
firefly.SetColor(8, firefly.RGB{R: 0x09, G: 0x18, B: 0x37})
firefly.SetColor(9, firefly.RGB{R: 0x28, G: 0x19, B: 0x61})
firefly.SetColor(10, firefly.RGB{R: 0x55, G: 0x20, B: 0x67})
firefly.SetColor(11, firefly.RGB{R: 0x70, G: 0x27, B: 0x63})
firefly.SetColor(12, firefly.RGB{R: 0x86, G: 0x34, B: 0x53})
firefly.SetColor(13, firefly.RGB{R: 0xa1, G: 0x4b, B: 0x4b})
firefly.SetColor(14, firefly.RGB{R: 0xb6, G: 0x7a, B: 0x5b})
firefly.SetColor(15, firefly.RGB{R: 0xc8, G: 0xa2, B: 0x6e})
firefly.SetColor(16, firefly.RGB{R: 0xe1, G: 0xd4, B: 0x83})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/punolite
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0x64, .g = 0xc2, .b = 0x24});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x0f, .g = 0xa1, .b = 0x0d});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0x09, .g = 0x79, .b = 0x38});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0x0b, .g = 0x64, .b = 0x57});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0x0a, .g = 0x50, .b = 0x58});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0x0a, .g = 0x41, .b = 0x58});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0x0a, .g = 0x2e, .b = 0x58});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0x09, .g = 0x18, .b = 0x37});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x28, .g = 0x19, .b = 0x61});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x55, .g = 0x20, .b = 0x67});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0x70, .g = 0x27, .b = 0x63});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x86, .g = 0x34, .b = 0x53});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xa1, .g = 0x4b, .b = 0x4b});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0xb6, .g = 0x7a, .b = 0x5b});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xc8, .g = 0xa2, .b = 0x6e});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0xe1, .g = 0xd4, .b = 0x83});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/punolite
RGB color1 = {0x64, 0xc2, 0x24};
set_color(1, color1);
RGB color2 = {0x0f, 0xa1, 0x0d};
set_color(2, color2);
RGB color3 = {0x09, 0x79, 0x38};
set_color(3, color3);
RGB color4 = {0x0b, 0x64, 0x57};
set_color(4, color4);
RGB color5 = {0x0a, 0x50, 0x58};
set_color(5, color5);
RGB color6 = {0x0a, 0x41, 0x58};
set_color(6, color6);
RGB color7 = {0x0a, 0x2e, 0x58};
set_color(7, color7);
RGB color8 = {0x09, 0x18, 0x37};
set_color(8, color8);
RGB color9 = {0x28, 0x19, 0x61};
set_color(9, color9);
RGB color10 = {0x55, 0x20, 0x67};
set_color(10, color10);
RGB color11 = {0x70, 0x27, 0x63};
set_color(11, color11);
RGB color12 = {0x86, 0x34, 0x53};
set_color(12, color12);
RGB color13 = {0xa1, 0x4b, 0x4b};
set_color(13, color13);
RGB color14 = {0xb6, 0x7a, 0x5b};
set_color(14, color14);
RGB color15 = {0xc8, 0xa2, 0x6e};
set_color(15, color15);
RGB color16 = {0xe1, 0xd4, 0x83};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/punolite
set_color(1, {0x64, 0xc2, 0x24});
set_color(2, {0x0f, 0xa1, 0x0d});
set_color(3, {0x09, 0x79, 0x38});
set_color(4, {0x0b, 0x64, 0x57});
set_color(5, {0x0a, 0x50, 0x58});
set_color(6, {0x0a, 0x41, 0x58});
set_color(7, {0x0a, 0x2e, 0x58});
set_color(8, {0x09, 0x18, 0x37});
set_color(9, {0x28, 0x19, 0x61});
set_color(10, {0x55, 0x20, 0x67});
set_color(11, {0x70, 0x27, 0x63});
set_color(12, {0x86, 0x34, 0x53});
set_color(13, {0xa1, 0x4b, 0x4b});
set_color(14, {0xb6, 0x7a, 0x5b});
set_color(15, {0xc8, 0xa2, 0x6e});
set_color(16, {0xe1, 0xd4, 0x83});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/punolite
@firefly.set_color(Color::from_int(1), RGB::new(0x64, 0xc2, 0x24));
@firefly.set_color(Color::from_int(2), RGB::new(0x0f, 0xa1, 0x0d));
@firefly.set_color(Color::from_int(3), RGB::new(0x09, 0x79, 0x38));
@firefly.set_color(Color::from_int(4), RGB::new(0x0b, 0x64, 0x57));
@firefly.set_color(Color::from_int(5), RGB::new(0x0a, 0x50, 0x58));
@firefly.set_color(Color::from_int(6), RGB::new(0x0a, 0x41, 0x58));
@firefly.set_color(Color::from_int(7), RGB::new(0x0a, 0x2e, 0x58));
@firefly.set_color(Color::from_int(8), RGB::new(0x09, 0x18, 0x37));
@firefly.set_color(Color::from_int(9), RGB::new(0x28, 0x19, 0x61));
@firefly.set_color(Color::from_int(10), RGB::new(0x55, 0x20, 0x67));
@firefly.set_color(Color::from_int(11), RGB::new(0x70, 0x27, 0x63));
@firefly.set_color(Color::from_int(12), RGB::new(0x86, 0x34, 0x53));
@firefly.set_color(Color::from_int(13), RGB::new(0xa1, 0x4b, 0x4b));
@firefly.set_color(Color::from_int(14), RGB::new(0xb6, 0x7a, 0x5b));
@firefly.set_color(Color::from_int(15), RGB::new(0xc8, 0xa2, 0x6e));
@firefly.set_color(Color::from_int(16), RGB::new(0xe1, 0xd4, 0x83));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/punolite
firefly.set_color(1, {r=0x64, g=0xc2, b=0x24});
firefly.set_color(2, {r=0x0f, g=0xa1, b=0x0d});
firefly.set_color(3, {r=0x09, g=0x79, b=0x38});
firefly.set_color(4, {r=0x0b, g=0x64, b=0x57});
firefly.set_color(5, {r=0x0a, g=0x50, b=0x58});
firefly.set_color(6, {r=0x0a, g=0x41, b=0x58});
firefly.set_color(7, {r=0x0a, g=0x2e, b=0x58});
firefly.set_color(8, {r=0x09, g=0x18, b=0x37});
firefly.set_color(9, {r=0x28, g=0x19, b=0x61});
firefly.set_color(10, {r=0x55, g=0x20, b=0x67});
firefly.set_color(11, {r=0x70, g=0x27, b=0x63});
firefly.set_color(12, {r=0x86, g=0x34, b=0x53});
firefly.set_color(13, {r=0xa1, g=0x4b, b=0x4b});
firefly.set_color(14, {r=0xb6, g=0x7a, b=0x5b});
firefly.set_color(15, {r=0xc8, g=0xa2, b=0x6e});
firefly.set_color(16, {r=0xe1, g=0xd4, b=0x83});
end