Palettes / vanilla milkshake

🦀 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/vanilla-milkshake
    set_color(Color::from(1), RGB::new(0x28, 0x28, 0x2e));
    set_color(Color::from(2), RGB::new(0x6c, 0x56, 0x71));
    set_color(Color::from(3), RGB::new(0xd9, 0xc8, 0xbf));
    set_color(Color::from(4), RGB::new(0xf9, 0x82, 0x84));
    set_color(Color::from(5), RGB::new(0xb0, 0xa9, 0xe4));
    set_color(Color::from(6), RGB::new(0xac, 0xcc, 0xe4));
    set_color(Color::from(7), RGB::new(0xb3, 0xe3, 0xda));
    set_color(Color::from(8), RGB::new(0xfe, 0xaa, 0xe4));
    set_color(Color::from(9), RGB::new(0x87, 0xa8, 0x89));
    set_color(Color::from(10), RGB::new(0xb0, 0xeb, 0x93));
    set_color(Color::from(11), RGB::new(0xe9, 0xf5, 0x9d));
    set_color(Color::from(12), RGB::new(0xff, 0xe6, 0xc6));
    set_color(Color::from(13), RGB::new(0xde, 0xa3, 0x8b));
    set_color(Color::from(14), RGB::new(0xff, 0xc3, 0x84));
    set_color(Color::from(15), RGB::new(0xff, 0xf7, 0xa0));
    set_color(Color::from(16), RGB::new(0xff, 0xf7, 0xe4));
}

🏃 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/vanilla-milkshake
    firefly.SetColor(1, firefly.RGB{R: 0x28, G: 0x28, B: 0x2e})
    firefly.SetColor(2, firefly.RGB{R: 0x6c, G: 0x56, B: 0x71})
    firefly.SetColor(3, firefly.RGB{R: 0xd9, G: 0xc8, B: 0xbf})
    firefly.SetColor(4, firefly.RGB{R: 0xf9, G: 0x82, B: 0x84})
    firefly.SetColor(5, firefly.RGB{R: 0xb0, G: 0xa9, B: 0xe4})
    firefly.SetColor(6, firefly.RGB{R: 0xac, G: 0xcc, B: 0xe4})
    firefly.SetColor(7, firefly.RGB{R: 0xb3, G: 0xe3, B: 0xda})
    firefly.SetColor(8, firefly.RGB{R: 0xfe, G: 0xaa, B: 0xe4})
    firefly.SetColor(9, firefly.RGB{R: 0x87, G: 0xa8, B: 0x89})
    firefly.SetColor(10, firefly.RGB{R: 0xb0, G: 0xeb, B: 0x93})
    firefly.SetColor(11, firefly.RGB{R: 0xe9, G: 0xf5, B: 0x9d})
    firefly.SetColor(12, firefly.RGB{R: 0xff, G: 0xe6, B: 0xc6})
    firefly.SetColor(13, firefly.RGB{R: 0xde, G: 0xa3, B: 0x8b})
    firefly.SetColor(14, firefly.RGB{R: 0xff, G: 0xc3, B: 0x84})
    firefly.SetColor(15, firefly.RGB{R: 0xff, G: 0xf7, B: 0xa0})
    firefly.SetColor(16, firefly.RGB{R: 0xff, G: 0xf7, B: 0xe4})
}

⚡️ Zig

const ff = @import("firefly");

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

fn setColors() void {
    // https://lospec.com/palette-list/vanilla-milkshake
    ff.setColor(@enumFromInt(1), ff.RGB{.r = 0x28, .g = 0x28, .b = 0x2e});
    ff.setColor(@enumFromInt(2), ff.RGB{.r = 0x6c, .g = 0x56, .b = 0x71});
    ff.setColor(@enumFromInt(3), ff.RGB{.r = 0xd9, .g = 0xc8, .b = 0xbf});
    ff.setColor(@enumFromInt(4), ff.RGB{.r = 0xf9, .g = 0x82, .b = 0x84});
    ff.setColor(@enumFromInt(5), ff.RGB{.r = 0xb0, .g = 0xa9, .b = 0xe4});
    ff.setColor(@enumFromInt(6), ff.RGB{.r = 0xac, .g = 0xcc, .b = 0xe4});
    ff.setColor(@enumFromInt(7), ff.RGB{.r = 0xb3, .g = 0xe3, .b = 0xda});
    ff.setColor(@enumFromInt(8), ff.RGB{.r = 0xfe, .g = 0xaa, .b = 0xe4});
    ff.setColor(@enumFromInt(9), ff.RGB{.r = 0x87, .g = 0xa8, .b = 0x89});
    ff.setColor(@enumFromInt(10), ff.RGB{.r = 0xb0, .g = 0xeb, .b = 0x93});
    ff.setColor(@enumFromInt(11), ff.RGB{.r = 0xe9, .g = 0xf5, .b = 0x9d});
    ff.setColor(@enumFromInt(12), ff.RGB{.r = 0xff, .g = 0xe6, .b = 0xc6});
    ff.setColor(@enumFromInt(13), ff.RGB{.r = 0xde, .g = 0xa3, .b = 0x8b});
    ff.setColor(@enumFromInt(14), ff.RGB{.r = 0xff, .g = 0xc3, .b = 0x84});
    ff.setColor(@enumFromInt(15), ff.RGB{.r = 0xff, .g = 0xf7, .b = 0xa0});
    ff.setColor(@enumFromInt(16), ff.RGB{.r = 0xff, .g = 0xf7, .b = 0xe4});
}

🐀 C

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

BOOT void boot()
{
    set_colors();
}

void set_colors()
{
    // https://lospec.com/palette-list/vanilla-milkshake
    RGB color1 = {0x28, 0x28, 0x2e};
    set_color(1, color1);
    RGB color2 = {0x6c, 0x56, 0x71};
    set_color(2, color2);
    RGB color3 = {0xd9, 0xc8, 0xbf};
    set_color(3, color3);
    RGB color4 = {0xf9, 0x82, 0x84};
    set_color(4, color4);
    RGB color5 = {0xb0, 0xa9, 0xe4};
    set_color(5, color5);
    RGB color6 = {0xac, 0xcc, 0xe4};
    set_color(6, color6);
    RGB color7 = {0xb3, 0xe3, 0xda};
    set_color(7, color7);
    RGB color8 = {0xfe, 0xaa, 0xe4};
    set_color(8, color8);
    RGB color9 = {0x87, 0xa8, 0x89};
    set_color(9, color9);
    RGB color10 = {0xb0, 0xeb, 0x93};
    set_color(10, color10);
    RGB color11 = {0xe9, 0xf5, 0x9d};
    set_color(11, color11);
    RGB color12 = {0xff, 0xe6, 0xc6};
    set_color(12, color12);
    RGB color13 = {0xde, 0xa3, 0x8b};
    set_color(13, color13);
    RGB color14 = {0xff, 0xc3, 0x84};
    set_color(14, color14);
    RGB color15 = {0xff, 0xf7, 0xa0};
    set_color(15, color15);
    RGB color16 = {0xff, 0xf7, 0xe4};
    set_color(16, color16);
}

➕ C++

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

BOOT void boot()
{
    set_colors();
}

void set_colors()
{
    // https://lospec.com/palette-list/vanilla-milkshake
    set_color(1, {0x28, 0x28, 0x2e});
    set_color(2, {0x6c, 0x56, 0x71});
    set_color(3, {0xd9, 0xc8, 0xbf});
    set_color(4, {0xf9, 0x82, 0x84});
    set_color(5, {0xb0, 0xa9, 0xe4});
    set_color(6, {0xac, 0xcc, 0xe4});
    set_color(7, {0xb3, 0xe3, 0xda});
    set_color(8, {0xfe, 0xaa, 0xe4});
    set_color(9, {0x87, 0xa8, 0x89});
    set_color(10, {0xb0, 0xeb, 0x93});
    set_color(11, {0xe9, 0xf5, 0x9d});
    set_color(12, {0xff, 0xe6, 0xc6});
    set_color(13, {0xde, 0xa3, 0x8b});
    set_color(14, {0xff, 0xc3, 0x84});
    set_color(15, {0xff, 0xf7, 0xa0});
    set_color(16, {0xff, 0xf7, 0xe4});
}

🐰 MoonBit

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

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

///|
fn set_colors() -> Unit {
  // https://lospec.com/palette-list/vanilla-milkshake
  @firefly.set_color(Color::from_int(1), RGB::new(0x28, 0x28, 0x2e));
  @firefly.set_color(Color::from_int(2), RGB::new(0x6c, 0x56, 0x71));
  @firefly.set_color(Color::from_int(3), RGB::new(0xd9, 0xc8, 0xbf));
  @firefly.set_color(Color::from_int(4), RGB::new(0xf9, 0x82, 0x84));
  @firefly.set_color(Color::from_int(5), RGB::new(0xb0, 0xa9, 0xe4));
  @firefly.set_color(Color::from_int(6), RGB::new(0xac, 0xcc, 0xe4));
  @firefly.set_color(Color::from_int(7), RGB::new(0xb3, 0xe3, 0xda));
  @firefly.set_color(Color::from_int(8), RGB::new(0xfe, 0xaa, 0xe4));
  @firefly.set_color(Color::from_int(9), RGB::new(0x87, 0xa8, 0x89));
  @firefly.set_color(Color::from_int(10), RGB::new(0xb0, 0xeb, 0x93));
  @firefly.set_color(Color::from_int(11), RGB::new(0xe9, 0xf5, 0x9d));
  @firefly.set_color(Color::from_int(12), RGB::new(0xff, 0xe6, 0xc6));
  @firefly.set_color(Color::from_int(13), RGB::new(0xde, 0xa3, 0x8b));
  @firefly.set_color(Color::from_int(14), RGB::new(0xff, 0xc3, 0x84));
  @firefly.set_color(Color::from_int(15), RGB::new(0xff, 0xf7, 0xa0));
  @firefly.set_color(Color::from_int(16), RGB::new(0xff, 0xf7, 0xe4));
}

🌙 Lua

function boot()
  set_colors()
end

function set_colors()
  -- https://lospec.com/palette-list/vanilla-milkshake
  firefly.set_color(1, {r=0x28, g=0x28, b=0x2e});
  firefly.set_color(2, {r=0x6c, g=0x56, b=0x71});
  firefly.set_color(3, {r=0xd9, g=0xc8, b=0xbf});
  firefly.set_color(4, {r=0xf9, g=0x82, b=0x84});
  firefly.set_color(5, {r=0xb0, g=0xa9, b=0xe4});
  firefly.set_color(6, {r=0xac, g=0xcc, b=0xe4});
  firefly.set_color(7, {r=0xb3, g=0xe3, b=0xda});
  firefly.set_color(8, {r=0xfe, g=0xaa, b=0xe4});
  firefly.set_color(9, {r=0x87, g=0xa8, b=0x89});
  firefly.set_color(10, {r=0xb0, g=0xeb, b=0x93});
  firefly.set_color(11, {r=0xe9, g=0xf5, b=0x9d});
  firefly.set_color(12, {r=0xff, g=0xe6, b=0xc6});
  firefly.set_color(13, {r=0xde, g=0xa3, b=0x8b});
  firefly.set_color(14, {r=0xff, g=0xc3, b=0x84});
  firefly.set_color(15, {r=0xff, g=0xf7, b=0xa0});
  firefly.set_color(16, {r=0xff, g=0xf7, b=0xe4});
end