Initial Commit

This commit is contained in:
tnichols217 2025-02-16 23:04:58 -05:00
commit b765459fc5
22 changed files with 397 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

23
.github/workflows/build.yml vendored Executable file
View File

@ -0,0 +1,23 @@
name: Releases
on:
push:
tags:
- 'release-*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v30
- name: Build Project
shell: bash
run: |
sh build.sh
- uses: ncipollo/release-action@v1
with:
artifacts: "result/*"

4
.gitignore vendored Executable file
View File

@ -0,0 +1,4 @@
.direnv
build
result
out

18
build.nix Normal file
View File

@ -0,0 +1,18 @@
{ stdenv, imagemagick, envsubst, python3Full, ... }:
stdenv.mkDerivation {
pname = "BetaNuBranding";
version = "1.0.0";
src = ./.;
nativeBuildInputs = [ imagemagick envsubst python3Full ];
buildPhase = ''
python build.py
'';
installPhase = ''
mkdir -p $out
cp -r out/* $out
'';
}

65
build.py Normal file
View File

@ -0,0 +1,65 @@
from typing import Any
import subprocess
colors = [ "black", "color", "red", "white" ]
logos: list[tuple[str, list[tuple[str, list[str]]]] | tuple[str, list[tuple[str, list[str]] | tuple[str, list[str]]]]] = [("OX", [
("-uni", [ "FRATERNITY" ]),
("-uninologo", [ "FRATERNITY", "RED", "GOLD" ]),
("-chap", [ "FRATERNITY", "CWRU" ]),
("-bnnologo", [ "FRATERNITY", "CWRU", "RED", "GOLD" ]),
("-frat", [ "BN", "CWRU"]),
("-nologo", [ "BN", "CWRU", "RED", "GOLD" ])
]), ("logomark", [
("-uni", [ ]),
("-chap", [ "CWRU" ]),
("-frat", [ "CWRU", "BN" ]),
("-notag", [ "CWRU", "BN", "TAG" ]),
("-nologo", [ "CWRU", "BN", "TAG", "RED", "GOLD" ])
]), ("stacked", [
("-uni", [ "TOP", "CENTER" ]),
("-chap", [ "CWRU", "TOP", "BOTTOM" ]),
("-frat", [ "CWRU", "BN", "CENTER", "BOTTOM" ]),
("-notag", [ "CWRU", "BN", "TOP", "CENTER", "BOTTOM" ]),
("-nologo", [ "CWRU", "BN", "RED", "GOLD", "TOP", "CENTER", "BOTTOM" ])
]), ("logo", [
("", [ ])
])]
script = '''
set -euxo pipefail
mkdir -p ./out
'''
def build(filename: str):
return f"envsubst -i ./template.svg -o out/{filename} --no-unset"
for color in colors:
script += f'''
source ./colors/{color}.sh
source ./style.sh
'''
for logo in logos:
des = logo[0]
for image in logo[1]:
script += f'''
source ./designs/{des}.sh
'''
for var in image[1]:
script += f'''
export {var}=\"\"
'''
script += f'''
source ./post.sh
{build(f"{des}{image[0]}-{color}.svg")}
'''
script += '''
mogrify -format png -density 2500 -background none out/*.svg
'''
_ = subprocess.run(["bash", "-c", script], check=True)

3
build.sh Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
nix build --experimental-features "nix-command flakes" .#branding

2
colors/black.sh Normal file
View File

@ -0,0 +1,2 @@
export RED="#000000"
export GOLD="#000000"

2
colors/color.sh Normal file
View File

@ -0,0 +1,2 @@
export RED="#C8102E" # PMS 186
export GOLD="#B9975B" # PMS 465

2
colors/red.sh Normal file
View File

@ -0,0 +1,2 @@
export RED="#C8102E" # PMS 186
export GOLD="#C8102E" # PMS 186

2
colors/white.sh Normal file
View File

@ -0,0 +1,2 @@
export RED="#FFFFFF"
export GOLD="#FFFFFF"

14
designs/OX.sh Normal file

File diff suppressed because one or more lines are too long

14
designs/logo.sh Normal file
View File

@ -0,0 +1,14 @@
export CWRU=""
export BN=""
export TAG=""
export OX=""
export RED="M 0,8.0995783e-5 1.0365752,0.73436477 1.0386451,8.0995783e-5 Z m 2.5785198,0 V 1.8944404 l 5.164e-4,0.0021 c 0,8.279e-4 -5.164e-4,0.0018 -5.164e-4,0.0026 v 6.937717 C 2.7652241,8.9516009 2.9572667,9.0454535 3.1515813,9.1184791 V 2.0412437 c 0.00777,0.055837 0.055126,0.099215 0.1131657,0.099215 0.063405,0 0.1147155,-0.051267 0.1147155,-0.1147161 0,-0.023819 -0.00877,-0.044708 -0.021186,-0.063037 l 0.3446638,0.075446 c 0,0 0.030575,4.6107075 0.1643226,7.2570603 0.024646,0.003 0.04925,0.00535 0.073893,0.00775 C 4.0757339,6.6578703 4.1059951,2.038668 4.1059951,2.038668 L 4.5751927,2.011799 C 4.6366667,2.009699 4.6861315,1.959032 4.6862912,1.8970829 V 1.8965663 C 4.6859956,1.8333196 4.6348621,1.7818512 4.5715757,1.7818512 c -0.063443,0 -0.1147156,0.051277 -0.1147156,0.1147151 0,0.027679 0.011062,0.052507 0.027386,0.072346 l -0.360166,-0.082156 -0.02532,-0.0041 -0.3891032,-0.086815 -0.00207,0.085266 -0.4376764,0.030488 -0.015502,9.999e-4 c -0.00588,5.53e-4 -0.011412,0.0022 -0.017052,0.0036 -0.043964,0.011159 -0.078367,0.045918 -0.085779,0.090945 V 1.2999323e-4 Z m 0,1.899010104217 v -0.0047 c -0.0013,-0.062257 -0.052139,-0.1126492 -0.1147159,-0.1126492 -0.063484,0 -0.1147158,0.051267 -0.1147158,0.1147161 0,0.027679 0.011063,0.052507 0.027388,0.072346 L 2.0163099,1.886648 1.9909899,1.882548 1.6018864,1.795733 1.5998164,1.880999 1.1621398,1.911487 1.1466378,1.9124869 c -0.00588,5.52e-4 -0.011453,0.0022 -0.017053,0.0036 -0.049801,0.012619 -0.087328,0.055807 -0.087328,0.1095483 0,0.063407 0.051232,0.1147161 0.1147159,0.1147161 0.063405,0 0.1147153,-0.051307 0.1147153,-0.1147161 0,-0.023819 -0.00881,-0.044668 -0.021186,-0.063047 l 0.3451804,0.075446 c 0,0 0.021029,3.1838964 0.104898,5.7786743 0.056977,0.1205792 0.1173391,0.2326061 0.1813745,0.3353626 0.09353,-2.6467082 0.1162663,-6.1135199 0.1162663,-6.1135199 L 2.467418,2.0116833 C 2.52822,2.0095833 2.5772152,1.9599963 2.5785164,1.8990341 Z M 1.7956626,0.00628167 c -0.1311466,0 -0.2376993,0.10651346 -0.2376993,0.23769963 0,0.0714063 0.032281,0.13474298 0.082162,0.17827472 l 0.312626,0.0697564 -0.00207,-0.0697564 c 0.049879,-0.0435277 0.082162,-0.10686544 0.082162,-0.17827472 0,-0.13118617 -0.1059964,-0.23769963 -0.2371825,-0.23769963 z m 2.107255,0 c -0.1311466,0 -0.2371824,0.10651346 -0.2371824,0.23769963 0,0.0714063 0.032281,0.13474298 0.082161,0.17827472 l 0.3126261,0.0697564 -0.00207,-0.0697564 c 0.04988,-0.0435277 0.082162,-0.10686544 0.082162,-0.17827472 0,-0.13118617 -0.1065132,-0.23769963 -0.2376992,-0.23769963 z m -2.2674438,0.5725452 -0.00413,0.15243806 0.3301952,0.0733762 -0.00413,-0.15398698 z m 2.1077719,0 -0.00413,0.15243806 0.3301951,0.0733762 -0.00465,-0.15398698 z M 1.6272064,0.88318502 1.6230766,1.0351061 1.969807,1.1126221 1.9656773,0.95863409 Z m 2.1077716,0 -0.00413,0.15192108 0.3467308,0.077516 -0.00413,-0.15398801 z M 1.6189385,1.1875442 1.6148087,1.3394643 1.9785918,1.42059 1.973942,1.2666031 Z m 2.1077717,0 -0.00413,0.1519201 0.3632664,0.081126 -0.00413,-0.1539869 z m -2.1160396,0.3038412 -0.00413,0.152437 0.3803187,0.084746 -0.00413,-0.153988 z m 2.1077718,0 -0.00465,0.152437 0.3808354,0.084746 -0.00413,-0.153988 z m 3.565488,2.0297444 c -0.027867,5.246e-4 -0.055906,0.00804 -0.081645,0.023253 -0.079137,0.046962 -0.1048759,0.1492605 -0.057875,0.228398 0.046923,0.079137 0.1487438,0.1053532 0.2278813,0.058391 0.029376,-0.017428 0.051387,-0.042644 0.065109,-0.071309 L 7.296332,3.5211298 c -0.00396,-2.07e-4 -0.00842,-7.49e-5 -0.012402,0 z"
export GOLD="m 7.0695129,6.4416777 -0.281141,0.078231 C 6.7323798,6.5354839 6.6738651,6.5024406 6.65829,6.4464495 l -0.010803,-0.0388 C 6.631912,6.3516575 6.664994,6.2931428 6.720946,6.2775676 l 0.2811411,-0.078231 c 0.055952,-0.015575 0.1145067,0.017468 0.1300819,0.073459 l 0.010804,0.0388 C 7.158548,6.3675866 7.125466,6.4261024 7.069514,6.4416775 M 6.5414965,6.1564364 6.5267493,6.1189773 c -0.021293,-0.054059 0.00548,-0.1156896 0.059501,-0.1370217 l 0.2715199,-0.107015 c 0.054059,-0.021293 0.1156897,0.00552 0.1369823,0.059541 l 0.014786,0.037499 c 0.021293,0.05402 -0.00548,0.1156898 -0.059541,0.1369824 L 6.6785181,6.2159769 C 6.6244589,6.2372698 6.5627889,6.2104972 6.5414963,6.156436 M 6.3967856,5.8756499 6.3782135,5.8399258 C 6.3514399,5.7883894 6.3717039,5.7242755 6.4232432,5.697502 L 6.6822241,5.5629644 c 0.051575,-0.026774 0.1156503,-0.00651 0.1424238,0.04507 l 0.018572,0.035724 c 0.026774,0.051575 0.00651,0.1156503 -0.04503,0.1424237 L 6.539209,5.9207193 c -0.051536,0.026774 -0.1156503,0.00651 -0.1424238,-0.04507 M 6.2565301,5.5995167 6.2336993,5.5663164 C 6.200814,5.5184079 6.2131163,5.4523222 6.2609858,5.419437 L 6.4507264,5.2891184 c 0.047868,-0.032885 0.1139547,-0.020622 0.14684,0.027286 l 0.022831,0.0332 c 0.032885,0.047868 0.020622,0.1139548 -0.027286,0.1468794 l -0.1897022,0.13028 C 6.355541,5.6596489 6.2894154,5.6473856 6.2565301,5.5995171 M 6.0800777,5.3369479 6.054369,5.3059156 C 6.0173039,5.2612009 6.0235736,5.1942872 6.0682883,5.1572223 L 6.207321,5.0420058 c 0.044754,-0.037065 0.1116678,-0.030795 0.1487327,0.013919 l 0.025709,0.031032 c 0.037065,0.044715 0.030795,0.1116284 -0.013919,0.1486932 L 6.2288103,5.3509067 C 6.1840566,5.3879708 6.1171427,5.3816621 6.0800779,5.3369474 M 5.8885628,5.0957104 5.8588714,5.0684638 C 5.8160496,5.0292299 5.8130928,4.9620797 5.8523617,4.919258 L 5.9317757,4.832549 C 5.9710487,4.789688 6.0381991,4.78677 6.0810209,4.825999 l 0.029731,0.027208 c 0.042822,0.039234 0.04574,0.1063841 0.00651,0.1492453 l -0.079453,0.086708 c -0.039234,0.042822 -0.1063841,0.045779 -0.1492454,0.00655 M 7.3246258,0 C 6.2361014,0.12428553 5.8170712,0.84385607 5.8078444,1.4907564 5.8012248,1.9571041 5.9640295,2.5242362 6.6565118,2.7564437 7.015489,2.788107 7.2494314,3.0272933 7.4039998,3.3415561 7.4626328,3.4607551 7.5447675,3.419984 7.592242,3.691622 7.6207895,3.8547074 7.8210191,4.1306437 7.8304036,4.2972778 7.8322535,4.3302811 7.5773372,4.411824 7.5362111,4.4080387 7.32849,4.3890727 7.1265259,4.2972778 6.9682904,4.1630557 6.9403339,4.1393579 6.8961322,4.1234677 6.8570169,4.1118353 6.3620431,3.9649165 6.2349579,3.8054193 6.1672554,3.269477 6.1657955,3.2581206 6.1589359,3.2220815 6.1411528,3.1697572 5.7923486,2.9876661 5.1696588,2.5200967 5.1274285,1.4898504 5.1037307,0.91290047 5.2916968,0.43894315 5.6380957,9.9994794e-7 H 4.6864353 V 1.8963423 l 3.94e-5,3.15e-4 -3.94e-5,3.159e-4 V 9.2800988 C 5.1528612,9.2043527 5.5898325,9.0131135 5.955434,8.7156875 6.5795041,8.2079776 6.8428224,7.525077 6.7613585,6.6249526 c -0.00312,-0.031702 0.026656,-0.037775 0.026656,-0.037775 l 0.3304688,-0.059541 c 0,0 0.036079,-0.00706 0.044794,0.031899 C 7.4255693,7.6671849 7.037019,8.4353741 6.5940149,9.0304231 6.3622806,9.3417287 6.0249508,9.6293757 5.6434586,9.8661968 L 8.348603,8.658552 V 0.73447576 L 9.385,0 Z"
export FRATERNITY=""
export TC=""
export TOP=""
export CENTER=""
export BOTTOM=""
export WIDTH="9.3850002"
export HEIGHT="9.8661966"

14
designs/logomark.sh Normal file

File diff suppressed because one or more lines are too long

14
designs/stacked.sh Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
designs/stacked/top.env Normal file

File diff suppressed because one or more lines are too long

129
flake.lock generated Normal file
View File

@ -0,0 +1,129 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1666603677,
"narHash": "sha256-apAEIj+z1iwMaMJ4tB21r/VTetfGDLDzuhXRHJknIAU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "074da18a72269cc5a6cf444dce42daea5649b2fe",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1739580444,
"narHash": "sha256-+/bSz4EAVbqz8/HsIGLroF8aNaO8bLRL7WfACN+24g4=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8bb37161a0488b89830168b81c48aed11569cb93",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1735554305,
"narHash": "sha256-zExSA1i/b+1NMRhGGLtNfFGXgLtgo+dcuzHzaWA6w3Q=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0e82ab234249d8eee3e8c91437802b32c74bb3fd",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": "nixpkgs_2",
"treefmt-nix": "treefmt-nix"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1738953846,
"narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "4f09b473c936d41582dd744e19f34ec27592c5fd",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

52
flake.nix Normal file
View File

@ -0,0 +1,52 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
treefmt-nix.url = "github:numtide/treefmt-nix";
gitignore.url = "github:hercules-ci/gitignore.nix";
};
outputs = {...} @ inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system: let
pkgs = (import inputs.nixpkgs) {
inherit system;
config = {
# allowUnfree = true;
# allowBroken = true;
};
};
in {
devShells = rec {
py = pkgs.mkShell {
packages = with pkgs; [
imagemagick
python3Full
envsubst
];
};
default = py;
};
formatter = let
treefmtconfig = inputs.treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs = {
toml-sort.enable = true;
yamlfmt.enable = true;
mdformat.enable = true;
prettier.enable = true;
shellcheck.enable = true;
shfmt.enable = true;
};
settings.formatter.shellcheck.excludes = [".envrc"];
};
in
treefmtconfig.config.build.wrapper;
apps = rec {
};
packages = rec {
branding = pkgs.callPackage ./build.nix { };
default = branding;
};
}
);
}

16
post.sh Normal file
View File

@ -0,0 +1,16 @@
export CWRU="<path id=\"cwru\" style=\"$STYLEGOLD\" ${CLIPPATH} d=\"${CWRU}\" />"
export BN="<path id=\"bn\" style=\"${STYLERED}\" ${CLIPPATH} d=\"${BN}\" />"
export TAG="<path id=\"tag\" style=\"${STYLEGOLD}\" ${CLIPPATH} d=\"${TAG}${TOP}${CENTER}${BOTTOM}\" />"
export OX="<path id=\"OX\" style=\"${STYLERED}\" ${CLIPPATH} d=\"${OX}\" />"
export RED="<path id=\"red\" style=\"${STYLERED}\" ${CLIPPATH} d=\"${RED}\" />"
export GOLD="<path id=\"gold\" style=\"${STYLEGOLD}\" ${CLIPPATH} d=\"${GOLD}\" />"
export FRATERNITY="<path id=\"fraternity\" style=\"${STYLERED}\" ${CLIPPATH} d=\"${FRATERNITY}\" />"
export TC="<path id=\"tc\" style=\"${STYLERED}\" ${CLIPPATH} d=\"${TC}\" />"
export LOGO="<g id=\"logo\"> ${RED} ${GOLD} </g>"
export MARK="<g id=\"mark\"> ${FRATERNITY} ${TC} </g>"
export TAG="<g id=\"mark\"> ${TAG} ${TOP} ${CENTER} ${BOTTOM} </g>"
export VB="0 0 ${WIDTH} ${HEIGHT}"
export WIDTH="${WIDTH}mm"
export HEIGHT="${HEIGHT}mm"

3
style.sh Normal file
View File

@ -0,0 +1,3 @@
export STYLERED="fill:${RED};fill-opacity:1;fill-rule:nonzero;stroke:none"
export STYLEGOLD="fill:${GOLD};fill-opacity:1;fill-rule:nonzero;stroke:none"
export CLIPPATH="clip-path=\"none\""

16
template.svg Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="${WIDTH}"
height="${HEIGHT}"
viewBox="${VB}"
version="1.1"
id="svg1"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
${CWRU}
${BN}
${TAG}
${OX}
${LOGO}
${MARK}
</svg>

After

Width:  |  Height:  |  Size: 313 B