Compare commits

..

9 Commits

Author SHA1 Message Date
tnichols217
e8d5d95fa0 fix dark mode 2025-09-21 17:35:17 -04:00
tnichols217
c8f9d9dabf add dark theme 2025-09-21 17:22:14 -04:00
tnichols217
04d6ff687c undo 2025-08-05 15:29:32 -04:00
tnichols217
035f6c4718 fix build script 2025-08-05 15:28:26 -04:00
tnichols217
05dfbc1a45 add bg variants 2025-02-26 19:55:58 -05:00
tnichols217
a23d38c90f Add branding.yml to the build 2025-02-17 13:18:04 -05:00
tnichols217
b14695a147 update readme 2025-02-16 23:45:54 -05:00
tnichols217
4a2d191117 update README 2025-02-16 23:35:38 -05:00
tnichols217
245af65ade update github action to produce zip 2025-02-16 23:23:09 -05:00
28 changed files with 97 additions and 24 deletions

0
.envrc Normal file → Executable file
View File

32
README.md Executable file
View File

@ -0,0 +1,32 @@
# Branding of the Beta Nu chapter of Theta Chi
This repo contains all the source code required for generating all the branding releated with the Beta Nu chapter of Theta Chi.
`SVG` `path` `d` attributes are stored in environment variables that will be built into the template SVG file.
Documentation on `d` attributes may be found [here](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d)
Extraction of the `d` attribute may also be done by extracting an svg then copying the `d` attribute from the file.
## Usage
This repo will be automatically built upon any push with a tag starting with `release-`. Artifacts will be produced as a GitHub release.
A nix flake is also provided with the `#branding` attribute, this is useful for cross-repo-referencing. This is used in the bylaw build process.
## Branding elements
The `src/colors` folder contains color variants for different color schemes for models. All files referenced from the `src/build.py` builder will be built as a variant of the branding.
## Build process
The build process is managed by the `src/build.py` script
1. It iterates over specified color schemes
2. It iterates over logo variants, including the logomark, logo, OX logo, and stacked logomark variants
3. Builds each variant of the specified logo by sourcing the variables and running `envsubst` on the template file
4. Then, uses the `mogrify` command from `imagemagick` to build `.png` versions of all the variants
5. Releases:
- For the GitHub release, a zip file will be made containing all the variants
- For the nix flake, all raw files are provided in the `result` folder
- An additional attribute `.#branding-nopng` is provided for quicker builds

11
build.nix Normal file → Executable file
View File

@ -1,14 +1,17 @@
{ stdenv, imagemagick, envsubst, python3Full, ... }:
{ stdenv, imagemagick, envsubst, python3Full, zip, util-linux, nopng ? false, bg ? "none", ... }:
stdenv.mkDerivation {
pname = "BetaNuBranding";
version = "1.0.0";
version = "1.0.1";
src = ./.;
src = ./src;
nativeBuildInputs = [ imagemagick envsubst python3Full ];
nativeBuildInputs = [ imagemagick envsubst python3Full zip util-linux ];
buildPhase = ''
python build.py
cd out
${if nopng then "" else "mogrify -format png -density 2500 -background ${bg} *.svg" }
cd ..
'';
installPhase = ''

2
build.sh Normal file → Executable file
View File

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

View File

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

View File

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

View File

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

View File

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

12
deploy.nix Executable file
View File

@ -0,0 +1,12 @@
{ src, stdenv, zip, ... }:
stdenv.mkDerivation {
inherit src;
pname = "GH-Action-builder";
version = "0.0.1";
nativeBuildInputs = [ zip ];
installPhase = ''
mkdir -p $out
zip $out/branding.zip ./*
'';
}

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

0
flake.lock generated Normal file → Executable file
View File

4
flake.nix Normal file → Executable file
View File

@ -45,6 +45,10 @@
};
packages = rec {
branding = pkgs.callPackage ./build.nix { };
branding-nopng = pkgs.callPackage ./build.nix { nopng = true; };
branding-white = pkgs.callPackage ./build.nix { bg = "white"; };
branding-black = pkgs.callPackage ./build.nix { bg = "black"; };
deploy = pkgs.callPackage ./deploy.nix { src = branding; };
default = branding;
};
}

14
src/_brand.yml Executable file
View File

@ -0,0 +1,14 @@
color:
palette:
military-red: "${RED}"
resolute-gold: "${GOLD}"
process-black: "${BLACK}"
white: "${WHITE}"
background: white
foreground: process-black
primary: military-red
secondary: resolute-gold
logo:
small: branding/logo-${COLOR}.svg
medium: branding/logomark-uni-${COLOR}.svg
large: branding/stacked-uni-${COLOR}.svg

10
build.py → src/build.py Normal file → Executable file
View File

@ -1,9 +1,6 @@
from typing import Any
import subprocess
colors = [ "black", "color", "red", "white" ]
colors = [ "black", "color", "color_dark", "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" ]),
@ -40,6 +37,7 @@ for color in colors:
script += f'''
source ./colors/{color}.sh
source ./style.sh
envsubst -i ./_brand.yml -o out/_brand-{color}.yml
'''
for logo in logos:
@ -58,8 +56,4 @@ for color in colors:
{build(f"{des}{image[0]}-{color}.svg")}
'''
script += '''
mogrify -format png -density 2500 -background none out/*.svg
'''
_ = subprocess.run(["bash", "-c", script], check=True)

5
src/colors/black.sh Executable file
View File

@ -0,0 +1,5 @@
export RED="#000000"
export GOLD="#000000"
export BLACK="#000000"
export WHITE="#FFFFFF"
export COLOR="black"

5
src/colors/color.sh Executable file
View File

@ -0,0 +1,5 @@
export RED="#C8102E" # PMS 186
export GOLD="#B9975B" # PMS 465
export BLACK="#000000"
export WHITE="#FFFFFF"
export COLOR="color"

5
src/colors/color_dark.sh Executable file
View File

@ -0,0 +1,5 @@
export RED="#C8102E" # PMS 186
export GOLD="#B9975B" # PMS 465
export BLACK="#FFFFFF"
export WHITE="#000000"
export COLOR="color_dark"

5
src/colors/red.sh Executable file
View File

@ -0,0 +1,5 @@
export RED="#C8102E" # PMS 186
export GOLD="#C8102E" # PMS 186
export BLACK="#000000"
export WHITE="#FFFFFF"
export COLOR="red"

5
src/colors/white.sh Executable file
View File

@ -0,0 +1,5 @@
export RED="#FFFFFF"
export GOLD="#FFFFFF"
export BLACK="#000000"
export WHITE="#000000"
export COLOR="white"

0
designs/OX.sh → src/designs/OX.sh Normal file → Executable file
View File

0
designs/logo.sh → src/designs/logo.sh Normal file → Executable file
View File

0
designs/logomark.sh → src/designs/logomark.sh Normal file → Executable file
View File

0
designs/stacked.sh → src/designs/stacked.sh Normal file → Executable file
View File

0
post.sh → src/post.sh Normal file → Executable file
View File

0
style.sh → src/style.sh Normal file → Executable file
View File

0
template.svg → src/template.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B