🦀 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/island-joy-16
set_color(Color::from(1), RGB::new(0xff, 0xff, 0xff));
set_color(Color::from(2), RGB::new(0x6d, 0xf7, 0xc1));
set_color(Color::from(3), RGB::new(0x11, 0xad, 0xc1));
set_color(Color::from(4), RGB::new(0x60, 0x6c, 0x81));
set_color(Color::from(5), RGB::new(0x39, 0x34, 0x57));
set_color(Color::from(6), RGB::new(0x1e, 0x88, 0x75));
set_color(Color::from(7), RGB::new(0x5b, 0xb3, 0x61));
set_color(Color::from(8), RGB::new(0xa1, 0xe5, 0x5a));
set_color(Color::from(9), RGB::new(0xf7, 0xe4, 0x76));
set_color(Color::from(10), RGB::new(0xf9, 0x92, 0x52));
set_color(Color::from(11), RGB::new(0xcb, 0x4d, 0x68));
set_color(Color::from(12), RGB::new(0x6a, 0x37, 0x71));
set_color(Color::from(13), RGB::new(0xc9, 0x24, 0x64));
set_color(Color::from(14), RGB::new(0xf4, 0x8c, 0xb6));
set_color(Color::from(15), RGB::new(0xf7, 0xb6, 0x9e));
set_color(Color::from(16), RGB::new(0x9b, 0x9c, 0x82));
}
🏃 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/island-joy-16
firefly.SetColor(1, firefly.RGB{R: 0xff, G: 0xff, B: 0xff})
firefly.SetColor(2, firefly.RGB{R: 0x6d, G: 0xf7, B: 0xc1})
firefly.SetColor(3, firefly.RGB{R: 0x11, G: 0xad, B: 0xc1})
firefly.SetColor(4, firefly.RGB{R: 0x60, G: 0x6c, B: 0x81})
firefly.SetColor(5, firefly.RGB{R: 0x39, G: 0x34, B: 0x57})
firefly.SetColor(6, firefly.RGB{R: 0x1e, G: 0x88, B: 0x75})
firefly.SetColor(7, firefly.RGB{R: 0x5b, G: 0xb3, B: 0x61})
firefly.SetColor(8, firefly.RGB{R: 0xa1, G: 0xe5, B: 0x5a})
firefly.SetColor(9, firefly.RGB{R: 0xf7, G: 0xe4, B: 0x76})
firefly.SetColor(10, firefly.RGB{R: 0xf9, G: 0x92, B: 0x52})
firefly.SetColor(11, firefly.RGB{R: 0xcb, G: 0x4d, B: 0x68})
firefly.SetColor(12, firefly.RGB{R: 0x6a, G: 0x37, B: 0x71})
firefly.SetColor(13, firefly.RGB{R: 0xc9, G: 0x24, B: 0x64})
firefly.SetColor(14, firefly.RGB{R: 0xf4, G: 0x8c, B: 0xb6})
firefly.SetColor(15, firefly.RGB{R: 0xf7, G: 0xb6, B: 0x9e})
firefly.SetColor(16, firefly.RGB{R: 0x9b, G: 0x9c, B: 0x82})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/island-joy-16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0xff, .g = 0xff, .b = 0xff});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x6d, .g = 0xf7, .b = 0xc1});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0x11, .g = 0xad, .b = 0xc1});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0x60, .g = 0x6c, .b = 0x81});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0x39, .g = 0x34, .b = 0x57});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0x1e, .g = 0x88, .b = 0x75});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0x5b, .g = 0xb3, .b = 0x61});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0xa1, .g = 0xe5, .b = 0x5a});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0xf7, .g = 0xe4, .b = 0x76});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0xf9, .g = 0x92, .b = 0x52});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0xcb, .g = 0x4d, .b = 0x68});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x6a, .g = 0x37, .b = 0x71});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xc9, .g = 0x24, .b = 0x64});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0xf4, .g = 0x8c, .b = 0xb6});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xf7, .g = 0xb6, .b = 0x9e});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x9b, .g = 0x9c, .b = 0x82});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/island-joy-16
RGB color1 = {0xff, 0xff, 0xff};
set_color(1, color1);
RGB color2 = {0x6d, 0xf7, 0xc1};
set_color(2, color2);
RGB color3 = {0x11, 0xad, 0xc1};
set_color(3, color3);
RGB color4 = {0x60, 0x6c, 0x81};
set_color(4, color4);
RGB color5 = {0x39, 0x34, 0x57};
set_color(5, color5);
RGB color6 = {0x1e, 0x88, 0x75};
set_color(6, color6);
RGB color7 = {0x5b, 0xb3, 0x61};
set_color(7, color7);
RGB color8 = {0xa1, 0xe5, 0x5a};
set_color(8, color8);
RGB color9 = {0xf7, 0xe4, 0x76};
set_color(9, color9);
RGB color10 = {0xf9, 0x92, 0x52};
set_color(10, color10);
RGB color11 = {0xcb, 0x4d, 0x68};
set_color(11, color11);
RGB color12 = {0x6a, 0x37, 0x71};
set_color(12, color12);
RGB color13 = {0xc9, 0x24, 0x64};
set_color(13, color13);
RGB color14 = {0xf4, 0x8c, 0xb6};
set_color(14, color14);
RGB color15 = {0xf7, 0xb6, 0x9e};
set_color(15, color15);
RGB color16 = {0x9b, 0x9c, 0x82};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/island-joy-16
set_color(1, {0xff, 0xff, 0xff});
set_color(2, {0x6d, 0xf7, 0xc1});
set_color(3, {0x11, 0xad, 0xc1});
set_color(4, {0x60, 0x6c, 0x81});
set_color(5, {0x39, 0x34, 0x57});
set_color(6, {0x1e, 0x88, 0x75});
set_color(7, {0x5b, 0xb3, 0x61});
set_color(8, {0xa1, 0xe5, 0x5a});
set_color(9, {0xf7, 0xe4, 0x76});
set_color(10, {0xf9, 0x92, 0x52});
set_color(11, {0xcb, 0x4d, 0x68});
set_color(12, {0x6a, 0x37, 0x71});
set_color(13, {0xc9, 0x24, 0x64});
set_color(14, {0xf4, 0x8c, 0xb6});
set_color(15, {0xf7, 0xb6, 0x9e});
set_color(16, {0x9b, 0x9c, 0x82});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/island-joy-16
@firefly.set_color(Color::from_int(1), RGB::new(0xff, 0xff, 0xff));
@firefly.set_color(Color::from_int(2), RGB::new(0x6d, 0xf7, 0xc1));
@firefly.set_color(Color::from_int(3), RGB::new(0x11, 0xad, 0xc1));
@firefly.set_color(Color::from_int(4), RGB::new(0x60, 0x6c, 0x81));
@firefly.set_color(Color::from_int(5), RGB::new(0x39, 0x34, 0x57));
@firefly.set_color(Color::from_int(6), RGB::new(0x1e, 0x88, 0x75));
@firefly.set_color(Color::from_int(7), RGB::new(0x5b, 0xb3, 0x61));
@firefly.set_color(Color::from_int(8), RGB::new(0xa1, 0xe5, 0x5a));
@firefly.set_color(Color::from_int(9), RGB::new(0xf7, 0xe4, 0x76));
@firefly.set_color(Color::from_int(10), RGB::new(0xf9, 0x92, 0x52));
@firefly.set_color(Color::from_int(11), RGB::new(0xcb, 0x4d, 0x68));
@firefly.set_color(Color::from_int(12), RGB::new(0x6a, 0x37, 0x71));
@firefly.set_color(Color::from_int(13), RGB::new(0xc9, 0x24, 0x64));
@firefly.set_color(Color::from_int(14), RGB::new(0xf4, 0x8c, 0xb6));
@firefly.set_color(Color::from_int(15), RGB::new(0xf7, 0xb6, 0x9e));
@firefly.set_color(Color::from_int(16), RGB::new(0x9b, 0x9c, 0x82));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/island-joy-16
firefly.set_color(1, {r=0xff, g=0xff, b=0xff});
firefly.set_color(2, {r=0x6d, g=0xf7, b=0xc1});
firefly.set_color(3, {r=0x11, g=0xad, b=0xc1});
firefly.set_color(4, {r=0x60, g=0x6c, b=0x81});
firefly.set_color(5, {r=0x39, g=0x34, b=0x57});
firefly.set_color(6, {r=0x1e, g=0x88, b=0x75});
firefly.set_color(7, {r=0x5b, g=0xb3, b=0x61});
firefly.set_color(8, {r=0xa1, g=0xe5, b=0x5a});
firefly.set_color(9, {r=0xf7, g=0xe4, b=0x76});
firefly.set_color(10, {r=0xf9, g=0x92, b=0x52});
firefly.set_color(11, {r=0xcb, g=0x4d, b=0x68});
firefly.set_color(12, {r=0x6a, g=0x37, b=0x71});
firefly.set_color(13, {r=0xc9, g=0x24, b=0x64});
firefly.set_color(14, {r=0xf4, g=0x8c, b=0xb6});
firefly.set_color(15, {r=0xf7, g=0xb6, b=0x9e});
firefly.set_color(16, {r=0x9b, g=0x9c, b=0x82});
end