🦀 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/r-place
set_color(Color::from(1), RGB::new(0xFF, 0xFF, 0xFF));
set_color(Color::from(2), RGB::new(0xE4, 0xE4, 0xE4));
set_color(Color::from(3), RGB::new(0x88, 0x88, 0x88));
set_color(Color::from(4), RGB::new(0x22, 0x22, 0x22));
set_color(Color::from(5), RGB::new(0xFF, 0xA7, 0xD1));
set_color(Color::from(6), RGB::new(0xE5, 0x00, 0x00));
set_color(Color::from(7), RGB::new(0xE5, 0x95, 0x00));
set_color(Color::from(8), RGB::new(0xA0, 0x6A, 0x42));
set_color(Color::from(9), RGB::new(0xE5, 0xD9, 0x00));
set_color(Color::from(10), RGB::new(0x94, 0xE0, 0x44));
set_color(Color::from(11), RGB::new(0x02, 0xBE, 0x01));
set_color(Color::from(12), RGB::new(0x00, 0xD3, 0xDD));
set_color(Color::from(13), RGB::new(0x00, 0x83, 0xC7));
set_color(Color::from(14), RGB::new(0x00, 0x00, 0xEA));
set_color(Color::from(15), RGB::new(0xCF, 0x6E, 0xE4));
set_color(Color::from(16), RGB::new(0x82, 0x00, 0x80));
}
🏃 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/r-place
firefly.SetColor(1, firefly.RGB{R: 0xFF, G: 0xFF, B: 0xFF})
firefly.SetColor(2, firefly.RGB{R: 0xE4, G: 0xE4, B: 0xE4})
firefly.SetColor(3, firefly.RGB{R: 0x88, G: 0x88, B: 0x88})
firefly.SetColor(4, firefly.RGB{R: 0x22, G: 0x22, B: 0x22})
firefly.SetColor(5, firefly.RGB{R: 0xFF, G: 0xA7, B: 0xD1})
firefly.SetColor(6, firefly.RGB{R: 0xE5, G: 0x00, B: 0x00})
firefly.SetColor(7, firefly.RGB{R: 0xE5, G: 0x95, B: 0x00})
firefly.SetColor(8, firefly.RGB{R: 0xA0, G: 0x6A, B: 0x42})
firefly.SetColor(9, firefly.RGB{R: 0xE5, G: 0xD9, B: 0x00})
firefly.SetColor(10, firefly.RGB{R: 0x94, G: 0xE0, B: 0x44})
firefly.SetColor(11, firefly.RGB{R: 0x02, G: 0xBE, B: 0x01})
firefly.SetColor(12, firefly.RGB{R: 0x00, G: 0xD3, B: 0xDD})
firefly.SetColor(13, firefly.RGB{R: 0x00, G: 0x83, B: 0xC7})
firefly.SetColor(14, firefly.RGB{R: 0x00, G: 0x00, B: 0xEA})
firefly.SetColor(15, firefly.RGB{R: 0xCF, G: 0x6E, B: 0xE4})
firefly.SetColor(16, firefly.RGB{R: 0x82, G: 0x00, B: 0x80})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/r-place
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0xFF, .g = 0xFF, .b = 0xFF});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0xE4, .g = 0xE4, .b = 0xE4});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0x88, .g = 0x88, .b = 0x88});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0x22, .g = 0x22, .b = 0x22});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0xFF, .g = 0xA7, .b = 0xD1});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0xE5, .g = 0x00, .b = 0x00});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0xE5, .g = 0x95, .b = 0x00});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0xA0, .g = 0x6A, .b = 0x42});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0xE5, .g = 0xD9, .b = 0x00});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x94, .g = 0xE0, .b = 0x44});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0x02, .g = 0xBE, .b = 0x01});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x00, .g = 0xD3, .b = 0xDD});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0x00, .g = 0x83, .b = 0xC7});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0x00, .g = 0x00, .b = 0xEA});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xCF, .g = 0x6E, .b = 0xE4});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x82, .g = 0x00, .b = 0x80});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/r-place
RGB color1 = {0xFF, 0xFF, 0xFF};
set_color(1, color1);
RGB color2 = {0xE4, 0xE4, 0xE4};
set_color(2, color2);
RGB color3 = {0x88, 0x88, 0x88};
set_color(3, color3);
RGB color4 = {0x22, 0x22, 0x22};
set_color(4, color4);
RGB color5 = {0xFF, 0xA7, 0xD1};
set_color(5, color5);
RGB color6 = {0xE5, 0x00, 0x00};
set_color(6, color6);
RGB color7 = {0xE5, 0x95, 0x00};
set_color(7, color7);
RGB color8 = {0xA0, 0x6A, 0x42};
set_color(8, color8);
RGB color9 = {0xE5, 0xD9, 0x00};
set_color(9, color9);
RGB color10 = {0x94, 0xE0, 0x44};
set_color(10, color10);
RGB color11 = {0x02, 0xBE, 0x01};
set_color(11, color11);
RGB color12 = {0x00, 0xD3, 0xDD};
set_color(12, color12);
RGB color13 = {0x00, 0x83, 0xC7};
set_color(13, color13);
RGB color14 = {0x00, 0x00, 0xEA};
set_color(14, color14);
RGB color15 = {0xCF, 0x6E, 0xE4};
set_color(15, color15);
RGB color16 = {0x82, 0x00, 0x80};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/r-place
set_color(1, {0xFF, 0xFF, 0xFF});
set_color(2, {0xE4, 0xE4, 0xE4});
set_color(3, {0x88, 0x88, 0x88});
set_color(4, {0x22, 0x22, 0x22});
set_color(5, {0xFF, 0xA7, 0xD1});
set_color(6, {0xE5, 0x00, 0x00});
set_color(7, {0xE5, 0x95, 0x00});
set_color(8, {0xA0, 0x6A, 0x42});
set_color(9, {0xE5, 0xD9, 0x00});
set_color(10, {0x94, 0xE0, 0x44});
set_color(11, {0x02, 0xBE, 0x01});
set_color(12, {0x00, 0xD3, 0xDD});
set_color(13, {0x00, 0x83, 0xC7});
set_color(14, {0x00, 0x00, 0xEA});
set_color(15, {0xCF, 0x6E, 0xE4});
set_color(16, {0x82, 0x00, 0x80});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/r-place
@firefly.set_color(Color::from_int(1), RGB::new(0xFF, 0xFF, 0xFF));
@firefly.set_color(Color::from_int(2), RGB::new(0xE4, 0xE4, 0xE4));
@firefly.set_color(Color::from_int(3), RGB::new(0x88, 0x88, 0x88));
@firefly.set_color(Color::from_int(4), RGB::new(0x22, 0x22, 0x22));
@firefly.set_color(Color::from_int(5), RGB::new(0xFF, 0xA7, 0xD1));
@firefly.set_color(Color::from_int(6), RGB::new(0xE5, 0x00, 0x00));
@firefly.set_color(Color::from_int(7), RGB::new(0xE5, 0x95, 0x00));
@firefly.set_color(Color::from_int(8), RGB::new(0xA0, 0x6A, 0x42));
@firefly.set_color(Color::from_int(9), RGB::new(0xE5, 0xD9, 0x00));
@firefly.set_color(Color::from_int(10), RGB::new(0x94, 0xE0, 0x44));
@firefly.set_color(Color::from_int(11), RGB::new(0x02, 0xBE, 0x01));
@firefly.set_color(Color::from_int(12), RGB::new(0x00, 0xD3, 0xDD));
@firefly.set_color(Color::from_int(13), RGB::new(0x00, 0x83, 0xC7));
@firefly.set_color(Color::from_int(14), RGB::new(0x00, 0x00, 0xEA));
@firefly.set_color(Color::from_int(15), RGB::new(0xCF, 0x6E, 0xE4));
@firefly.set_color(Color::from_int(16), RGB::new(0x82, 0x00, 0x80));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/r-place
firefly.set_color(1, {r=0xFF, g=0xFF, b=0xFF});
firefly.set_color(2, {r=0xE4, g=0xE4, b=0xE4});
firefly.set_color(3, {r=0x88, g=0x88, b=0x88});
firefly.set_color(4, {r=0x22, g=0x22, b=0x22});
firefly.set_color(5, {r=0xFF, g=0xA7, b=0xD1});
firefly.set_color(6, {r=0xE5, g=0x00, b=0x00});
firefly.set_color(7, {r=0xE5, g=0x95, b=0x00});
firefly.set_color(8, {r=0xA0, g=0x6A, b=0x42});
firefly.set_color(9, {r=0xE5, g=0xD9, b=0x00});
firefly.set_color(10, {r=0x94, g=0xE0, b=0x44});
firefly.set_color(11, {r=0x02, g=0xBE, b=0x01});
firefly.set_color(12, {r=0x00, g=0xD3, b=0xDD});
firefly.set_color(13, {r=0x00, g=0x83, b=0xC7});
firefly.set_color(14, {r=0x00, g=0x00, b=0xEA});
firefly.set_color(15, {r=0xCF, g=0x6E, b=0xE4});
firefly.set_color(16, {r=0x82, g=0x00, b=0x80});
end