π¦ 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/bubblegum-16
set_color(Color::from(1), RGB::new(0x16, 0x17, 0x1a));
set_color(Color::from(2), RGB::new(0x7f, 0x06, 0x22));
set_color(Color::from(3), RGB::new(0xd6, 0x24, 0x11));
set_color(Color::from(4), RGB::new(0xff, 0x84, 0x26));
set_color(Color::from(5), RGB::new(0xff, 0xd1, 0x00));
set_color(Color::from(6), RGB::new(0xfa, 0xfd, 0xff));
set_color(Color::from(7), RGB::new(0xff, 0x80, 0xa4));
set_color(Color::from(8), RGB::new(0xff, 0x26, 0x74));
set_color(Color::from(9), RGB::new(0x94, 0x21, 0x6a));
set_color(Color::from(10), RGB::new(0x43, 0x00, 0x67));
set_color(Color::from(11), RGB::new(0x23, 0x49, 0x75));
set_color(Color::from(12), RGB::new(0x68, 0xae, 0xd4));
set_color(Color::from(13), RGB::new(0xbf, 0xff, 0x3c));
set_color(Color::from(14), RGB::new(0x10, 0xd2, 0x75));
set_color(Color::from(15), RGB::new(0x00, 0x78, 0x99));
set_color(Color::from(16), RGB::new(0x00, 0x28, 0x59));
}
π 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/bubblegum-16
firefly.SetColor(1, firefly.RGB{R: 0x16, G: 0x17, B: 0x1a})
firefly.SetColor(2, firefly.RGB{R: 0x7f, G: 0x06, B: 0x22})
firefly.SetColor(3, firefly.RGB{R: 0xd6, G: 0x24, B: 0x11})
firefly.SetColor(4, firefly.RGB{R: 0xff, G: 0x84, B: 0x26})
firefly.SetColor(5, firefly.RGB{R: 0xff, G: 0xd1, B: 0x00})
firefly.SetColor(6, firefly.RGB{R: 0xfa, G: 0xfd, B: 0xff})
firefly.SetColor(7, firefly.RGB{R: 0xff, G: 0x80, B: 0xa4})
firefly.SetColor(8, firefly.RGB{R: 0xff, G: 0x26, B: 0x74})
firefly.SetColor(9, firefly.RGB{R: 0x94, G: 0x21, B: 0x6a})
firefly.SetColor(10, firefly.RGB{R: 0x43, G: 0x00, B: 0x67})
firefly.SetColor(11, firefly.RGB{R: 0x23, G: 0x49, B: 0x75})
firefly.SetColor(12, firefly.RGB{R: 0x68, G: 0xae, B: 0xd4})
firefly.SetColor(13, firefly.RGB{R: 0xbf, G: 0xff, B: 0x3c})
firefly.SetColor(14, firefly.RGB{R: 0x10, G: 0xd2, B: 0x75})
firefly.SetColor(15, firefly.RGB{R: 0x00, G: 0x78, B: 0x99})
firefly.SetColor(16, firefly.RGB{R: 0x00, G: 0x28, B: 0x59})
}
β‘οΈ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/bubblegum-16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0x16, .g = 0x17, .b = 0x1a});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x7f, .g = 0x06, .b = 0x22});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0xd6, .g = 0x24, .b = 0x11});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0xff, .g = 0x84, .b = 0x26});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0xff, .g = 0xd1, .b = 0x00});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0xfa, .g = 0xfd, .b = 0xff});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0xff, .g = 0x80, .b = 0xa4});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0xff, .g = 0x26, .b = 0x74});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x94, .g = 0x21, .b = 0x6a});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x43, .g = 0x00, .b = 0x67});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0x23, .g = 0x49, .b = 0x75});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x68, .g = 0xae, .b = 0xd4});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xbf, .g = 0xff, .b = 0x3c});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0x10, .g = 0xd2, .b = 0x75});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0x00, .g = 0x78, .b = 0x99});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x00, .g = 0x28, .b = 0x59});
}
π C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/bubblegum-16
RGB color1 = {0x16, 0x17, 0x1a};
set_color(1, color1);
RGB color2 = {0x7f, 0x06, 0x22};
set_color(2, color2);
RGB color3 = {0xd6, 0x24, 0x11};
set_color(3, color3);
RGB color4 = {0xff, 0x84, 0x26};
set_color(4, color4);
RGB color5 = {0xff, 0xd1, 0x00};
set_color(5, color5);
RGB color6 = {0xfa, 0xfd, 0xff};
set_color(6, color6);
RGB color7 = {0xff, 0x80, 0xa4};
set_color(7, color7);
RGB color8 = {0xff, 0x26, 0x74};
set_color(8, color8);
RGB color9 = {0x94, 0x21, 0x6a};
set_color(9, color9);
RGB color10 = {0x43, 0x00, 0x67};
set_color(10, color10);
RGB color11 = {0x23, 0x49, 0x75};
set_color(11, color11);
RGB color12 = {0x68, 0xae, 0xd4};
set_color(12, color12);
RGB color13 = {0xbf, 0xff, 0x3c};
set_color(13, color13);
RGB color14 = {0x10, 0xd2, 0x75};
set_color(14, color14);
RGB color15 = {0x00, 0x78, 0x99};
set_color(15, color15);
RGB color16 = {0x00, 0x28, 0x59};
set_color(16, color16);
}
β C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/bubblegum-16
set_color(1, {0x16, 0x17, 0x1a});
set_color(2, {0x7f, 0x06, 0x22});
set_color(3, {0xd6, 0x24, 0x11});
set_color(4, {0xff, 0x84, 0x26});
set_color(5, {0xff, 0xd1, 0x00});
set_color(6, {0xfa, 0xfd, 0xff});
set_color(7, {0xff, 0x80, 0xa4});
set_color(8, {0xff, 0x26, 0x74});
set_color(9, {0x94, 0x21, 0x6a});
set_color(10, {0x43, 0x00, 0x67});
set_color(11, {0x23, 0x49, 0x75});
set_color(12, {0x68, 0xae, 0xd4});
set_color(13, {0xbf, 0xff, 0x3c});
set_color(14, {0x10, 0xd2, 0x75});
set_color(15, {0x00, 0x78, 0x99});
set_color(16, {0x00, 0x28, 0x59});
}
π° MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/bubblegum-16
@firefly.set_color(Color::from_int(1), RGB::new(0x16, 0x17, 0x1a));
@firefly.set_color(Color::from_int(2), RGB::new(0x7f, 0x06, 0x22));
@firefly.set_color(Color::from_int(3), RGB::new(0xd6, 0x24, 0x11));
@firefly.set_color(Color::from_int(4), RGB::new(0xff, 0x84, 0x26));
@firefly.set_color(Color::from_int(5), RGB::new(0xff, 0xd1, 0x00));
@firefly.set_color(Color::from_int(6), RGB::new(0xfa, 0xfd, 0xff));
@firefly.set_color(Color::from_int(7), RGB::new(0xff, 0x80, 0xa4));
@firefly.set_color(Color::from_int(8), RGB::new(0xff, 0x26, 0x74));
@firefly.set_color(Color::from_int(9), RGB::new(0x94, 0x21, 0x6a));
@firefly.set_color(Color::from_int(10), RGB::new(0x43, 0x00, 0x67));
@firefly.set_color(Color::from_int(11), RGB::new(0x23, 0x49, 0x75));
@firefly.set_color(Color::from_int(12), RGB::new(0x68, 0xae, 0xd4));
@firefly.set_color(Color::from_int(13), RGB::new(0xbf, 0xff, 0x3c));
@firefly.set_color(Color::from_int(14), RGB::new(0x10, 0xd2, 0x75));
@firefly.set_color(Color::from_int(15), RGB::new(0x00, 0x78, 0x99));
@firefly.set_color(Color::from_int(16), RGB::new(0x00, 0x28, 0x59));
}
π Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/bubblegum-16
firefly.set_color(1, {r=0x16, g=0x17, b=0x1a});
firefly.set_color(2, {r=0x7f, g=0x06, b=0x22});
firefly.set_color(3, {r=0xd6, g=0x24, b=0x11});
firefly.set_color(4, {r=0xff, g=0x84, b=0x26});
firefly.set_color(5, {r=0xff, g=0xd1, b=0x00});
firefly.set_color(6, {r=0xfa, g=0xfd, b=0xff});
firefly.set_color(7, {r=0xff, g=0x80, b=0xa4});
firefly.set_color(8, {r=0xff, g=0x26, b=0x74});
firefly.set_color(9, {r=0x94, g=0x21, b=0x6a});
firefly.set_color(10, {r=0x43, g=0x00, b=0x67});
firefly.set_color(11, {r=0x23, g=0x49, b=0x75});
firefly.set_color(12, {r=0x68, g=0xae, b=0xd4});
firefly.set_color(13, {r=0xbf, g=0xff, b=0x3c});
firefly.set_color(14, {r=0x10, g=0xd2, b=0x75});
firefly.set_color(15, {r=0x00, g=0x78, b=0x99});
firefly.set_color(16, {r=0x00, g=0x28, b=0x59});
end