Palettes / Taffy 16

πŸ¦€ 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/taffy-16
    set_color(Color::from(1), RGB::new(0x22, 0x25, 0x33));
    set_color(Color::from(2), RGB::new(0x62, 0x75, 0xba));
    set_color(Color::from(3), RGB::new(0xa3, 0xc0, 0xe6));
    set_color(Color::from(4), RGB::new(0xfa, 0xff, 0xfc));
    set_color(Color::from(5), RGB::new(0xff, 0xab, 0x7b));
    set_color(Color::from(6), RGB::new(0xff, 0x6c, 0x7a));
    set_color(Color::from(7), RGB::new(0xdc, 0x43, 0x5b));
    set_color(Color::from(8), RGB::new(0x3f, 0x48, 0xc2));
    set_color(Color::from(9), RGB::new(0x44, 0x8d, 0xe7));
    set_color(Color::from(10), RGB::new(0x2b, 0xdb, 0x72));
    set_color(Color::from(11), RGB::new(0xa7, 0xf5, 0x47));
    set_color(Color::from(12), RGB::new(0xff, 0xeb, 0x33));
    set_color(Color::from(13), RGB::new(0xf5, 0x89, 0x31));
    set_color(Color::from(14), RGB::new(0xdb, 0x4b, 0x3d));
    set_color(Color::from(15), RGB::new(0xa6, 0x3d, 0x57));
    set_color(Color::from(16), RGB::new(0x36, 0x35, 0x4d));
}

πŸƒ 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/taffy-16
    firefly.SetColor(1, firefly.RGB{R: 0x22, G: 0x25, B: 0x33})
    firefly.SetColor(2, firefly.RGB{R: 0x62, G: 0x75, B: 0xba})
    firefly.SetColor(3, firefly.RGB{R: 0xa3, G: 0xc0, B: 0xe6})
    firefly.SetColor(4, firefly.RGB{R: 0xfa, G: 0xff, B: 0xfc})
    firefly.SetColor(5, firefly.RGB{R: 0xff, G: 0xab, B: 0x7b})
    firefly.SetColor(6, firefly.RGB{R: 0xff, G: 0x6c, B: 0x7a})
    firefly.SetColor(7, firefly.RGB{R: 0xdc, G: 0x43, B: 0x5b})
    firefly.SetColor(8, firefly.RGB{R: 0x3f, G: 0x48, B: 0xc2})
    firefly.SetColor(9, firefly.RGB{R: 0x44, G: 0x8d, B: 0xe7})
    firefly.SetColor(10, firefly.RGB{R: 0x2b, G: 0xdb, B: 0x72})
    firefly.SetColor(11, firefly.RGB{R: 0xa7, G: 0xf5, B: 0x47})
    firefly.SetColor(12, firefly.RGB{R: 0xff, G: 0xeb, B: 0x33})
    firefly.SetColor(13, firefly.RGB{R: 0xf5, G: 0x89, B: 0x31})
    firefly.SetColor(14, firefly.RGB{R: 0xdb, G: 0x4b, B: 0x3d})
    firefly.SetColor(15, firefly.RGB{R: 0xa6, G: 0x3d, B: 0x57})
    firefly.SetColor(16, firefly.RGB{R: 0x36, G: 0x35, B: 0x4d})
}

⚑️ Zig

const ff = @import("firefly");

pub export fn update() void {
    setColors()
}

fn setColors() void {
    // https://lospec.com/palette-list/taffy-16
    ff.setColor(@enumFromInt(1), ff.RGB{.r = 0x22, .g = 0x25, .b = 0x33});
    ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x62, .g = 0x75, .b = 0xba});
    ff.setColor(@enumFromInt(3), ff.RGB{.r = 0xa3, .g = 0xc0, .b = 0xe6});
    ff.setColor(@enumFromInt(4), ff.RGB{.r = 0xfa, .g = 0xff, .b = 0xfc});
    ff.setColor(@enumFromInt(5), ff.RGB{.r = 0xff, .g = 0xab, .b = 0x7b});
    ff.setColor(@enumFromInt(6), ff.RGB{.r = 0xff, .g = 0x6c, .b = 0x7a});
    ff.setColor(@enumFromInt(7), ff.RGB{.r = 0xdc, .g = 0x43, .b = 0x5b});
    ff.setColor(@enumFromInt(8), ff.RGB{.r = 0x3f, .g = 0x48, .b = 0xc2});
    ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x44, .g = 0x8d, .b = 0xe7});
    ff.setColor(@enumFromInt(10), ff.RGB{.r = 0x2b, .g = 0xdb, .b = 0x72});
    ff.setColor(@enumFromInt(11), ff.RGB{.r = 0xa7, .g = 0xf5, .b = 0x47});
    ff.setColor(@enumFromInt(12), ff.RGB{.r = 0xff, .g = 0xeb, .b = 0x33});
    ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xf5, .g = 0x89, .b = 0x31});
    ff.setColor(@enumFromInt(14), ff.RGB{.r = 0xdb, .g = 0x4b, .b = 0x3d});
    ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xa6, .g = 0x3d, .b = 0x57});
    ff.setColor(@enumFromInt(16), ff.RGB{.r = 0x36, .g = 0x35, .b = 0x4d});
}

πŸ€ C

#include "./vendor/firefly/firefly.c"

BOOT void boot()
{
    set_colors();
}

void set_colors()
{
    // https://lospec.com/palette-list/taffy-16
    RGB color1 = {0x22, 0x25, 0x33};
    set_color(1, color1);
    RGB color2 = {0x62, 0x75, 0xba};
    set_color(2, color2);
    RGB color3 = {0xa3, 0xc0, 0xe6};
    set_color(3, color3);
    RGB color4 = {0xfa, 0xff, 0xfc};
    set_color(4, color4);
    RGB color5 = {0xff, 0xab, 0x7b};
    set_color(5, color5);
    RGB color6 = {0xff, 0x6c, 0x7a};
    set_color(6, color6);
    RGB color7 = {0xdc, 0x43, 0x5b};
    set_color(7, color7);
    RGB color8 = {0x3f, 0x48, 0xc2};
    set_color(8, color8);
    RGB color9 = {0x44, 0x8d, 0xe7};
    set_color(9, color9);
    RGB color10 = {0x2b, 0xdb, 0x72};
    set_color(10, color10);
    RGB color11 = {0xa7, 0xf5, 0x47};
    set_color(11, color11);
    RGB color12 = {0xff, 0xeb, 0x33};
    set_color(12, color12);
    RGB color13 = {0xf5, 0x89, 0x31};
    set_color(13, color13);
    RGB color14 = {0xdb, 0x4b, 0x3d};
    set_color(14, color14);
    RGB color15 = {0xa6, 0x3d, 0x57};
    set_color(15, color15);
    RGB color16 = {0x36, 0x35, 0x4d};
    set_color(16, color16);
}

βž• C++

#include "./vendor/firefly/firefly.c"

BOOT void boot()
{
    set_colors();
}

void set_colors()
{
    // https://lospec.com/palette-list/taffy-16
    set_color(1, {0x22, 0x25, 0x33});
    set_color(2, {0x62, 0x75, 0xba});
    set_color(3, {0xa3, 0xc0, 0xe6});
    set_color(4, {0xfa, 0xff, 0xfc});
    set_color(5, {0xff, 0xab, 0x7b});
    set_color(6, {0xff, 0x6c, 0x7a});
    set_color(7, {0xdc, 0x43, 0x5b});
    set_color(8, {0x3f, 0x48, 0xc2});
    set_color(9, {0x44, 0x8d, 0xe7});
    set_color(10, {0x2b, 0xdb, 0x72});
    set_color(11, {0xa7, 0xf5, 0x47});
    set_color(12, {0xff, 0xeb, 0x33});
    set_color(13, {0xf5, 0x89, 0x31});
    set_color(14, {0xdb, 0x4b, 0x3d});
    set_color(15, {0xa6, 0x3d, 0x57});
    set_color(16, {0x36, 0x35, 0x4d});
}

🐰 MoonBit

///|
using @firefly {type Color, type RGB}

///|
pub fn boot() -> Unit {
  set_colors()
}

///|
fn set_colors() -> Unit {
  // https://lospec.com/palette-list/taffy-16
  @firefly.set_color(Color::from_int(1), RGB::new(0x22, 0x25, 0x33));
  @firefly.set_color(Color::from_int(2), RGB::new(0x62, 0x75, 0xba));
  @firefly.set_color(Color::from_int(3), RGB::new(0xa3, 0xc0, 0xe6));
  @firefly.set_color(Color::from_int(4), RGB::new(0xfa, 0xff, 0xfc));
  @firefly.set_color(Color::from_int(5), RGB::new(0xff, 0xab, 0x7b));
  @firefly.set_color(Color::from_int(6), RGB::new(0xff, 0x6c, 0x7a));
  @firefly.set_color(Color::from_int(7), RGB::new(0xdc, 0x43, 0x5b));
  @firefly.set_color(Color::from_int(8), RGB::new(0x3f, 0x48, 0xc2));
  @firefly.set_color(Color::from_int(9), RGB::new(0x44, 0x8d, 0xe7));
  @firefly.set_color(Color::from_int(10), RGB::new(0x2b, 0xdb, 0x72));
  @firefly.set_color(Color::from_int(11), RGB::new(0xa7, 0xf5, 0x47));
  @firefly.set_color(Color::from_int(12), RGB::new(0xff, 0xeb, 0x33));
  @firefly.set_color(Color::from_int(13), RGB::new(0xf5, 0x89, 0x31));
  @firefly.set_color(Color::from_int(14), RGB::new(0xdb, 0x4b, 0x3d));
  @firefly.set_color(Color::from_int(15), RGB::new(0xa6, 0x3d, 0x57));
  @firefly.set_color(Color::from_int(16), RGB::new(0x36, 0x35, 0x4d));
}

πŸŒ™ Lua

function boot()
  set_colors()
end

function set_colors()
  -- https://lospec.com/palette-list/taffy-16
  firefly.set_color(1, {r=0x22, g=0x25, b=0x33});
  firefly.set_color(2, {r=0x62, g=0x75, b=0xba});
  firefly.set_color(3, {r=0xa3, g=0xc0, b=0xe6});
  firefly.set_color(4, {r=0xfa, g=0xff, b=0xfc});
  firefly.set_color(5, {r=0xff, g=0xab, b=0x7b});
  firefly.set_color(6, {r=0xff, g=0x6c, b=0x7a});
  firefly.set_color(7, {r=0xdc, g=0x43, b=0x5b});
  firefly.set_color(8, {r=0x3f, g=0x48, b=0xc2});
  firefly.set_color(9, {r=0x44, g=0x8d, b=0xe7});
  firefly.set_color(10, {r=0x2b, g=0xdb, b=0x72});
  firefly.set_color(11, {r=0xa7, g=0xf5, b=0x47});
  firefly.set_color(12, {r=0xff, g=0xeb, b=0x33});
  firefly.set_color(13, {r=0xf5, g=0x89, b=0x31});
  firefly.set_color(14, {r=0xdb, g=0x4b, b=0x3d});
  firefly.set_color(15, {r=0xa6, g=0x3d, b=0x57});
  firefly.set_color(16, {r=0x36, g=0x35, b=0x4d});
end