🦀 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/peachy-pop-16
set_color(Color::from(1), RGB::new(0xfd, 0xff, 0xff));
set_color(Color::from(2), RGB::new(0xff, 0x86, 0x86));
set_color(Color::from(3), RGB::new(0xfb, 0x47, 0x71));
set_color(Color::from(4), RGB::new(0xce, 0x18, 0x6a));
set_color(Color::from(5), RGB::new(0x8f, 0x0b, 0x5f));
set_color(Color::from(6), RGB::new(0x53, 0x03, 0x4b));
set_color(Color::from(7), RGB::new(0xad, 0x6d, 0xea));
set_color(Color::from(8), RGB::new(0x9f, 0xb9, 0xff));
set_color(Color::from(9), RGB::new(0x56, 0x7f, 0xeb));
set_color(Color::from(10), RGB::new(0x0a, 0x54, 0x7b));
set_color(Color::from(11), RGB::new(0x27, 0x8c, 0x7f));
set_color(Color::from(12), RGB::new(0x0c, 0xe7, 0xa7));
set_color(Color::from(13), RGB::new(0xac, 0xfc, 0xad));
set_color(Color::from(14), RGB::new(0xff, 0xec, 0x6d));
set_color(Color::from(15), RGB::new(0xff, 0xa7, 0x63));
set_color(Color::from(16), RGB::new(0xff, 0x40, 0x40));
}
🏃 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/peachy-pop-16
firefly.SetColor(1, firefly.RGB{R: 0xfd, G: 0xff, B: 0xff})
firefly.SetColor(2, firefly.RGB{R: 0xff, G: 0x86, B: 0x86})
firefly.SetColor(3, firefly.RGB{R: 0xfb, G: 0x47, B: 0x71})
firefly.SetColor(4, firefly.RGB{R: 0xce, G: 0x18, B: 0x6a})
firefly.SetColor(5, firefly.RGB{R: 0x8f, G: 0x0b, B: 0x5f})
firefly.SetColor(6, firefly.RGB{R: 0x53, G: 0x03, B: 0x4b})
firefly.SetColor(7, firefly.RGB{R: 0xad, G: 0x6d, B: 0xea})
firefly.SetColor(8, firefly.RGB{R: 0x9f, G: 0xb9, B: 0xff})
firefly.SetColor(9, firefly.RGB{R: 0x56, G: 0x7f, B: 0xeb})
firefly.SetColor(10, firefly.RGB{R: 0x0a, G: 0x54, B: 0x7b})
firefly.SetColor(11, firefly.RGB{R: 0x27, G: 0x8c, B: 0x7f})
firefly.SetColor(12, firefly.RGB{R: 0x0c, G: 0xe7, B: 0xa7})
firefly.SetColor(13, firefly.RGB{R: 0xac, G: 0xfc, B: 0xad})
firefly.SetColor(14, firefly.RGB{R: 0xff, G: 0xec, B: 0x6d})
firefly.SetColor(15, firefly.RGB{R: 0xff, G: 0xa7, B: 0x63})
firefly.SetColor(16, firefly.RGB{R: 0xff, G: 0x40, B: 0x40})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/peachy-pop-16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0xfd, .g = 0xff, .b = 0xff});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0xff, .g = 0x86, .b = 0x86});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0xfb, .g = 0x47, .b = 0x71});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0xce, .g = 0x18, .b = 0x6a});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0x8f, .g = 0x0b, .b = 0x5f});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0x53, .g = 0x03, .b = 0x4b});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0xad, .g = 0x6d, .b = 0xea});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0x9f, .g = 0xb9, .b = 0xff});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x56, .g = 0x7f, .b = 0xeb});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x0a, .g = 0x54, .b = 0x7b});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0x27, .g = 0x8c, .b = 0x7f});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x0c, .g = 0xe7, .b = 0xa7});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xac, .g = 0xfc, .b = 0xad});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0xff, .g = 0xec, .b = 0x6d});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xff, .g = 0xa7, .b = 0x63});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0xff, .g = 0x40, .b = 0x40});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/peachy-pop-16
RGB color1 = {0xfd, 0xff, 0xff};
set_color(1, color1);
RGB color2 = {0xff, 0x86, 0x86};
set_color(2, color2);
RGB color3 = {0xfb, 0x47, 0x71};
set_color(3, color3);
RGB color4 = {0xce, 0x18, 0x6a};
set_color(4, color4);
RGB color5 = {0x8f, 0x0b, 0x5f};
set_color(5, color5);
RGB color6 = {0x53, 0x03, 0x4b};
set_color(6, color6);
RGB color7 = {0xad, 0x6d, 0xea};
set_color(7, color7);
RGB color8 = {0x9f, 0xb9, 0xff};
set_color(8, color8);
RGB color9 = {0x56, 0x7f, 0xeb};
set_color(9, color9);
RGB color10 = {0x0a, 0x54, 0x7b};
set_color(10, color10);
RGB color11 = {0x27, 0x8c, 0x7f};
set_color(11, color11);
RGB color12 = {0x0c, 0xe7, 0xa7};
set_color(12, color12);
RGB color13 = {0xac, 0xfc, 0xad};
set_color(13, color13);
RGB color14 = {0xff, 0xec, 0x6d};
set_color(14, color14);
RGB color15 = {0xff, 0xa7, 0x63};
set_color(15, color15);
RGB color16 = {0xff, 0x40, 0x40};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/peachy-pop-16
set_color(1, {0xfd, 0xff, 0xff});
set_color(2, {0xff, 0x86, 0x86});
set_color(3, {0xfb, 0x47, 0x71});
set_color(4, {0xce, 0x18, 0x6a});
set_color(5, {0x8f, 0x0b, 0x5f});
set_color(6, {0x53, 0x03, 0x4b});
set_color(7, {0xad, 0x6d, 0xea});
set_color(8, {0x9f, 0xb9, 0xff});
set_color(9, {0x56, 0x7f, 0xeb});
set_color(10, {0x0a, 0x54, 0x7b});
set_color(11, {0x27, 0x8c, 0x7f});
set_color(12, {0x0c, 0xe7, 0xa7});
set_color(13, {0xac, 0xfc, 0xad});
set_color(14, {0xff, 0xec, 0x6d});
set_color(15, {0xff, 0xa7, 0x63});
set_color(16, {0xff, 0x40, 0x40});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/peachy-pop-16
@firefly.set_color(Color::from_int(1), RGB::new(0xfd, 0xff, 0xff));
@firefly.set_color(Color::from_int(2), RGB::new(0xff, 0x86, 0x86));
@firefly.set_color(Color::from_int(3), RGB::new(0xfb, 0x47, 0x71));
@firefly.set_color(Color::from_int(4), RGB::new(0xce, 0x18, 0x6a));
@firefly.set_color(Color::from_int(5), RGB::new(0x8f, 0x0b, 0x5f));
@firefly.set_color(Color::from_int(6), RGB::new(0x53, 0x03, 0x4b));
@firefly.set_color(Color::from_int(7), RGB::new(0xad, 0x6d, 0xea));
@firefly.set_color(Color::from_int(8), RGB::new(0x9f, 0xb9, 0xff));
@firefly.set_color(Color::from_int(9), RGB::new(0x56, 0x7f, 0xeb));
@firefly.set_color(Color::from_int(10), RGB::new(0x0a, 0x54, 0x7b));
@firefly.set_color(Color::from_int(11), RGB::new(0x27, 0x8c, 0x7f));
@firefly.set_color(Color::from_int(12), RGB::new(0x0c, 0xe7, 0xa7));
@firefly.set_color(Color::from_int(13), RGB::new(0xac, 0xfc, 0xad));
@firefly.set_color(Color::from_int(14), RGB::new(0xff, 0xec, 0x6d));
@firefly.set_color(Color::from_int(15), RGB::new(0xff, 0xa7, 0x63));
@firefly.set_color(Color::from_int(16), RGB::new(0xff, 0x40, 0x40));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/peachy-pop-16
firefly.set_color(1, {r=0xfd, g=0xff, b=0xff});
firefly.set_color(2, {r=0xff, g=0x86, b=0x86});
firefly.set_color(3, {r=0xfb, g=0x47, b=0x71});
firefly.set_color(4, {r=0xce, g=0x18, b=0x6a});
firefly.set_color(5, {r=0x8f, g=0x0b, b=0x5f});
firefly.set_color(6, {r=0x53, g=0x03, b=0x4b});
firefly.set_color(7, {r=0xad, g=0x6d, b=0xea});
firefly.set_color(8, {r=0x9f, g=0xb9, b=0xff});
firefly.set_color(9, {r=0x56, g=0x7f, b=0xeb});
firefly.set_color(10, {r=0x0a, g=0x54, b=0x7b});
firefly.set_color(11, {r=0x27, g=0x8c, b=0x7f});
firefly.set_color(12, {r=0x0c, g=0xe7, b=0xa7});
firefly.set_color(13, {r=0xac, g=0xfc, b=0xad});
firefly.set_color(14, {r=0xff, g=0xec, b=0x6d});
firefly.set_color(15, {r=0xff, g=0xa7, b=0x63});
firefly.set_color(16, {r=0xff, g=0x40, b=0x40});
end