From 1d62d005a809c0b7e92360564b403925cc642871 Mon Sep 17 00:00:00 2001 From: Owen Ryan Date: Sun, 29 Jun 2025 06:48:52 -0400 Subject: [PATCH] Initial Commit --- .gitignore | 3 ++ LICENSE | 24 +++++++++++ README.md | 13 ++++++ build.py | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79291a4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.venv/ +.idea/ +riso.css diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/README.md b/README.md new file mode 100644 index 0000000..1060b0f --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# riso.css + +A simple CSS file with variables containing [Risograph](https://en.wikipedia.org/wiki/Risograph) Duplicator [ink colors](https://www.stencil.wiki/colors). + +## Generating the CSS file + +This repository contains a dependency-free `build.py` Python script that creates the CSS file. The CSS variable scope, +variable name prefix, and output filename can all be changed by modifying variables at the top of the script. + +```shell +python build.py +``` + diff --git a/build.py b/build.py new file mode 100644 index 0000000..6d27778 --- /dev/null +++ b/build.py @@ -0,0 +1,122 @@ +"""Build the riso.css file""" + +# Configuration + +# Filename to write the css data to +FILENAME = "riso.css" +# Prefix used by color variables (ex: "{prefix}-mint") +CSS_PREFIX = "riso" +# Variable Scope in the DOM +CSS_SCOPE = ":root" + +type nameT = str +type colorT = int + +# Color data from https://www.stencil.wiki/colors +COLORS: dict[nameT, colorT] = { + # "Standard" colors + "black": 0x000000, + "burgundy": 0x914E72, + "blue": 0x0078BF, + "green": 0x00A95C, + "medium-blue": 0x3255A4, + "bright-red": 0xF15060, + "risofedral-blue": 0x3D5588, + "purple": 0x765BA7, + "teal": 0x00838A, + "flat-gold": 0xBB8B41, + "hunter-green": 0x407060, + "red": 0xFF665E, + "brown": 0x925F52, + "yellow": 0xFFE800, + "marine-red": 0xD2515E, + "orange": 0xFF6C2F, + "fluorescent-pink": 0xFF48B0, + "light-gray": 0x88898A, + # "Special Edition" colors + "metallic-silver": 0x9C9C9C, + "flatallic-gold": 0xB48F50, + "metallic-gold": 0xAC936E, + "crimson": 0xE45D50, + "fluorescent-orange": 0xFF7477, + "cornflower": 0x62A8E5, + "sky-blue": 0x4982CF, + "sea-blue": 0x0074A2, + "lake": 0x235BA8, + "indigo": 0x484D7A, + "midnight": 0x435060, + "mist": 0xB8C7C4, + "granite": 0xA5AAA8, + "charcoal": 0x70747C, + "smoky-teal": 0x5F8289, + "steel": 0x375E77, + "slate": 0x5E695, + "turquoise": 0x00AA93, + "emerald": 0x19975D, + "grass": 0x397E58, + "forest": 0x516E5A, + "spruce": 0x4A635D, + "moss": 0x68724D, + "sea-foam": 0x62C2B1, + "kelly-green": 0x67B346, + "light-teal": 0x009DA5, + "ivy": 0x169B62, + "pine": 0x237E74, + "lagoon": 0x2F6165, + "violet": 0x9D7AD2, + "orchid": 0xBB76CF, + "plum": 0x845991, + "raisin": 0x775D7A, + "grape": 0x6C5D80, + "scarlet": 0xF65058, + "tomato": 0xD2515E, + "cranberry": 0xC24F5D, + "maroon": 0x9E4C6E, + "raspberry-red": 0xB4B65, + "brick": 0xA75154, + "light-lime": 0xE3ED55, + "sunflower": 0xFFB511, + "melon": 0xFFAE3B, + "apricot": 0xF6A04D, + "paprika": 0xEE7F4B, + "pumpkin": 0xFF6F4C, + "bright-olive-green": 0xB49F29, + "bright-gold": 0xBA8032, + "copper": 0xBD6439, + "mahogany": 0x8E595A, + "bisque": 0xF2CDCF, + "bubble-gum": 0xF984CA, + "light-mauve": 0xE6B5C9, + "dark-mauve": 0xBD8CA6, + "wine": 0x914E72, + "gray": 0x928D88, + # "Custom" colors + "coral": 0xFF8E91, + "white": 0xFFFFFF, + "aqua": 0x5EC9E5, + "mint": 0x82D8D5, + # Omitting "Clear Medium" as it is transparent + "fluorescent-yellow": 0xF7DD00, + "fluorescent-red": 0xFF4C65, + "fluorescent-green": 0x44D62C, +} + + +def main(): + # Open file for writing + with open(FILENAME, "w") as f: + # Write first line (css scope and open brace) + f.write(f"{CSS_SCOPE} {{\n") + + # Generate and write each CSS rule + f.writelines( + f"\t--{CSS_PREFIX}-{name}: #{color:06x};\n" + for name, color in COLORS.items() + ) + + # Write closing brace + f.write("}") + + +if __name__ == "__main__": + main()