🦀 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/cretaceous-16
set_color(Color::from(1), RGB::new(0x31, 0x34, 0x32));
set_color(Color::from(2), RGB::new(0x32, 0x3e, 0x42));
set_color(Color::from(3), RGB::new(0x45, 0x4b, 0x4b));
set_color(Color::from(4), RGB::new(0x3a, 0x5f, 0x3b));
set_color(Color::from(5), RGB::new(0x7c, 0x45, 0x45));
set_color(Color::from(6), RGB::new(0x67, 0x52, 0x39));
set_color(Color::from(7), RGB::new(0x62, 0x50, 0x55));
set_color(Color::from(8), RGB::new(0x51, 0x6b, 0x43));
set_color(Color::from(9), RGB::new(0x79, 0x6c, 0x64));
set_color(Color::from(10), RGB::new(0x71, 0x82, 0x45));
set_color(Color::from(11), RGB::new(0x9e, 0x80, 0x5c));
set_color(Color::from(12), RGB::new(0x99, 0x85, 0x79));
set_color(Color::from(13), RGB::new(0xac, 0x90, 0x86));
set_color(Color::from(14), RGB::new(0xa6, 0xa2, 0x96));
set_color(Color::from(15), RGB::new(0xb4, 0xab, 0x8f));
set_color(Color::from(16), RGB::new(0xbc, 0xb7, 0xa5));
}
🏃 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/cretaceous-16
firefly.SetColor(1, firefly.RGB{R: 0x31, G: 0x34, B: 0x32})
firefly.SetColor(2, firefly.RGB{R: 0x32, G: 0x3e, B: 0x42})
firefly.SetColor(3, firefly.RGB{R: 0x45, G: 0x4b, B: 0x4b})
firefly.SetColor(4, firefly.RGB{R: 0x3a, G: 0x5f, B: 0x3b})
firefly.SetColor(5, firefly.RGB{R: 0x7c, G: 0x45, B: 0x45})
firefly.SetColor(6, firefly.RGB{R: 0x67, G: 0x52, B: 0x39})
firefly.SetColor(7, firefly.RGB{R: 0x62, G: 0x50, B: 0x55})
firefly.SetColor(8, firefly.RGB{R: 0x51, G: 0x6b, B: 0x43})
firefly.SetColor(9, firefly.RGB{R: 0x79, G: 0x6c, B: 0x64})
firefly.SetColor(10, firefly.RGB{R: 0x71, G: 0x82, B: 0x45})
firefly.SetColor(11, firefly.RGB{R: 0x9e, G: 0x80, B: 0x5c})
firefly.SetColor(12, firefly.RGB{R: 0x99, G: 0x85, B: 0x79})
firefly.SetColor(13, firefly.RGB{R: 0xac, G: 0x90, B: 0x86})
firefly.SetColor(14, firefly.RGB{R: 0xa6, G: 0xa2, B: 0x96})
firefly.SetColor(15, firefly.RGB{R: 0xb4, G: 0xab, B: 0x8f})
firefly.SetColor(16, firefly.RGB{R: 0xbc, G: 0xb7, B: 0xa5})
}
⚡️ Zig
const ff = @import("firefly");
pub export fn update() void {
setColors()
}
fn setColors() void {
// https://lospec.com/palette-list/cretaceous-16
ff.setColor(@enumFromInt(1), ff.RGB{.r = 0x31, .g = 0x34, .b = 0x32});
ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x32, .g = 0x3e, .b = 0x42});
ff.setColor(@enumFromInt(3), ff.RGB{.r = 0x45, .g = 0x4b, .b = 0x4b});
ff.setColor(@enumFromInt(4), ff.RGB{.r = 0x3a, .g = 0x5f, .b = 0x3b});
ff.setColor(@enumFromInt(5), ff.RGB{.r = 0x7c, .g = 0x45, .b = 0x45});
ff.setColor(@enumFromInt(6), ff.RGB{.r = 0x67, .g = 0x52, .b = 0x39});
ff.setColor(@enumFromInt(7), ff.RGB{.r = 0x62, .g = 0x50, .b = 0x55});
ff.setColor(@enumFromInt(8), ff.RGB{.r = 0x51, .g = 0x6b, .b = 0x43});
ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x79, .g = 0x6c, .b = 0x64});
ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x71, .g = 0x82, .b = 0x45});
ff.setColor(@enumFromInt(11), ff.RGB{.r = 0x9e, .g = 0x80, .b = 0x5c});
ff.setColor(@enumFromInt(12), ff.RGB{.r = 0x99, .g = 0x85, .b = 0x79});
ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xac, .g = 0x90, .b = 0x86});
ff.setColor(@enumFromInt(14), ff.RGB{.r = 0xa6, .g = 0xa2, .b = 0x96});
ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xb4, .g = 0xab, .b = 0x8f});
ff.setColor(@enumFromInt(16), ff.RGB{.r = 0xbc, .g = 0xb7, .b = 0xa5});
}
🐀 C
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/cretaceous-16
RGB color1 = {0x31, 0x34, 0x32};
set_color(1, color1);
RGB color2 = {0x32, 0x3e, 0x42};
set_color(2, color2);
RGB color3 = {0x45, 0x4b, 0x4b};
set_color(3, color3);
RGB color4 = {0x3a, 0x5f, 0x3b};
set_color(4, color4);
RGB color5 = {0x7c, 0x45, 0x45};
set_color(5, color5);
RGB color6 = {0x67, 0x52, 0x39};
set_color(6, color6);
RGB color7 = {0x62, 0x50, 0x55};
set_color(7, color7);
RGB color8 = {0x51, 0x6b, 0x43};
set_color(8, color8);
RGB color9 = {0x79, 0x6c, 0x64};
set_color(9, color9);
RGB color10 = {0x71, 0x82, 0x45};
set_color(10, color10);
RGB color11 = {0x9e, 0x80, 0x5c};
set_color(11, color11);
RGB color12 = {0x99, 0x85, 0x79};
set_color(12, color12);
RGB color13 = {0xac, 0x90, 0x86};
set_color(13, color13);
RGB color14 = {0xa6, 0xa2, 0x96};
set_color(14, color14);
RGB color15 = {0xb4, 0xab, 0x8f};
set_color(15, color15);
RGB color16 = {0xbc, 0xb7, 0xa5};
set_color(16, color16);
}
➕ C++
#include "./vendor/firefly/firefly.c"
BOOT void boot()
{
set_colors();
}
void set_colors()
{
// https://lospec.com/palette-list/cretaceous-16
set_color(1, {0x31, 0x34, 0x32});
set_color(2, {0x32, 0x3e, 0x42});
set_color(3, {0x45, 0x4b, 0x4b});
set_color(4, {0x3a, 0x5f, 0x3b});
set_color(5, {0x7c, 0x45, 0x45});
set_color(6, {0x67, 0x52, 0x39});
set_color(7, {0x62, 0x50, 0x55});
set_color(8, {0x51, 0x6b, 0x43});
set_color(9, {0x79, 0x6c, 0x64});
set_color(10, {0x71, 0x82, 0x45});
set_color(11, {0x9e, 0x80, 0x5c});
set_color(12, {0x99, 0x85, 0x79});
set_color(13, {0xac, 0x90, 0x86});
set_color(14, {0xa6, 0xa2, 0x96});
set_color(15, {0xb4, 0xab, 0x8f});
set_color(16, {0xbc, 0xb7, 0xa5});
}
🐰 MoonBit
///|
using @firefly {type Color, type RGB}
///|
pub fn boot() -> Unit {
set_colors()
}
///|
fn set_colors() -> Unit {
// https://lospec.com/palette-list/cretaceous-16
@firefly.set_color(Color::from_int(1), RGB::new(0x31, 0x34, 0x32));
@firefly.set_color(Color::from_int(2), RGB::new(0x32, 0x3e, 0x42));
@firefly.set_color(Color::from_int(3), RGB::new(0x45, 0x4b, 0x4b));
@firefly.set_color(Color::from_int(4), RGB::new(0x3a, 0x5f, 0x3b));
@firefly.set_color(Color::from_int(5), RGB::new(0x7c, 0x45, 0x45));
@firefly.set_color(Color::from_int(6), RGB::new(0x67, 0x52, 0x39));
@firefly.set_color(Color::from_int(7), RGB::new(0x62, 0x50, 0x55));
@firefly.set_color(Color::from_int(8), RGB::new(0x51, 0x6b, 0x43));
@firefly.set_color(Color::from_int(9), RGB::new(0x79, 0x6c, 0x64));
@firefly.set_color(Color::from_int(10), RGB::new(0x71, 0x82, 0x45));
@firefly.set_color(Color::from_int(11), RGB::new(0x9e, 0x80, 0x5c));
@firefly.set_color(Color::from_int(12), RGB::new(0x99, 0x85, 0x79));
@firefly.set_color(Color::from_int(13), RGB::new(0xac, 0x90, 0x86));
@firefly.set_color(Color::from_int(14), RGB::new(0xa6, 0xa2, 0x96));
@firefly.set_color(Color::from_int(15), RGB::new(0xb4, 0xab, 0x8f));
@firefly.set_color(Color::from_int(16), RGB::new(0xbc, 0xb7, 0xa5));
}
🌙 Lua
function boot()
set_colors()
end
function set_colors()
-- https://lospec.com/palette-list/cretaceous-16
firefly.set_color(1, {r=0x31, g=0x34, b=0x32});
firefly.set_color(2, {r=0x32, g=0x3e, b=0x42});
firefly.set_color(3, {r=0x45, g=0x4b, b=0x4b});
firefly.set_color(4, {r=0x3a, g=0x5f, b=0x3b});
firefly.set_color(5, {r=0x7c, g=0x45, b=0x45});
firefly.set_color(6, {r=0x67, g=0x52, b=0x39});
firefly.set_color(7, {r=0x62, g=0x50, b=0x55});
firefly.set_color(8, {r=0x51, g=0x6b, b=0x43});
firefly.set_color(9, {r=0x79, g=0x6c, b=0x64});
firefly.set_color(10, {r=0x71, g=0x82, b=0x45});
firefly.set_color(11, {r=0x9e, g=0x80, b=0x5c});
firefly.set_color(12, {r=0x99, g=0x85, b=0x79});
firefly.set_color(13, {r=0xac, g=0x90, b=0x86});
firefly.set_color(14, {r=0xa6, g=0xa2, b=0x96});
firefly.set_color(15, {r=0xb4, g=0xab, b=0x8f});
firefly.set_color(16, {r=0xbc, g=0xb7, b=0xa5});
end