{"id":20815554,"url":"https://github.com/deepnight/deepnightlibs","last_synced_at":"2026-02-07T13:02:23.945Z","repository":{"id":35117154,"uuid":"208818495","full_name":"deepnight/deepnightLibs","owner":"deepnight","description":"The general personal libs I use in my Haxe projects.","archived":false,"fork":false,"pushed_at":"2026-01-23T15:10:44.000Z","size":4527,"stargazers_count":259,"open_issues_count":3,"forks_count":58,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-01-24T06:31:29.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://deepnight.net","language":"Haxe","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepnight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-16T14:19:31.000Z","updated_at":"2026-01-23T15:10:49.000Z","dependencies_parsed_at":"2023-09-23T01:41:16.858Z","dependency_job_id":"2b3c6d90-3689-4e29-9d5e-25a269a32633","html_url":"https://github.com/deepnight/deepnightLibs","commit_stats":null,"previous_names":[],"tags_count":74,"template":false,"template_full_name":null,"purl":"pkg:github/deepnight/deepnightLibs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepnight%2FdeepnightLibs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepnight%2FdeepnightLibs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepnight%2FdeepnightLibs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepnight%2FdeepnightLibs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepnight","download_url":"https://codeload.github.com/deepnight/deepnightLibs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepnight%2FdeepnightLibs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29194417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T12:38:28.597Z","status":"ssl_error","status_checked_at":"2026-02-07T12:38:23.888Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T21:23:58.446Z","updated_at":"2026-02-07T13:02:23.928Z","avatar_url":"https://github.com/deepnight.png","language":"Haxe","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThe general purpose libs I use in all my Haxe projects. If you want to build one of [my project](https://github.com/deepnight/), you will need them.\n\n[![Unit tests](https://github.com/deepnight/deepnightLibs/actions/workflows/runUnitTests.yml/badge.svg)](https://github.com/deepnight/deepnightLibs/actions/workflows/runUnitTests.yml)\n\n# Install\n\n## Stable\n\nUse this version if you plan to use the libs for your own projects.\n\n```bash\nhaxelib install deepnightLibs\n```\n\n## Latest Git version (mostly stable)\n\nThis is the version I use and update very frequently.\n\nPick this version if you're building one of my GitHub projects, such as LDtk or one of my gamejam entry.\n\n```bash\nhaxelib git deepnightLibs https://github.com/deepnight/deepnightLibs\n```\n\n# Usage\n\nIn your HXML file, add:\n```hxml\n-lib deepnightLibs\n```\n\nAll the libs are in the `dn.*` package.\n\n```haxe\nclass MyProject {\n\tpublic function new() {\n\t\ttrace( dn.M.fmin(0.3,0.8) ); // 0.3\n\t}\n}\n```\n\n# Tips\n\nUse global imports! To import libs in every HX files, just add a ``import.hx`` (this exact name \u0026 caps) file to the **root** of your ``src`` folder:\n\n```\ndn.*;\ndn.Col as C;\n```\n\n - The first line imports all classes in ``dn`` package,\n\n - The second one imports ``dn.Col`` as an alias \"C\",\n\n - Feel free to add your own convenient imports there.\n\n# Noteworthy classes\n\n## dn.M\n\nMy re-implementation of the Math class, with high-performances in mind:\n\n```haxe\nM.fmin(0.5, 0.9); // 0.5\nM.frandRange(0, 2); // random Float number between 0 -\u003e 2\nM.randRange(0, 2); // either 0, 1 or 2\nM.pow(val, 2); // turns into val*val at compilation time\n```\n\n## dn.Col\n\nThe color management lib, with performance in mind.\n\nA color is an abstract class that revolves around a single Integer value (the color in 0xaarrggbb format). Most methods are just operations on this internal Int value.\n\n```haxe\nimport dn.Col;\nvar c : Col = 0xff0000;  // red\nvar c : Col = Red;  // also red, but using and enum constant\nvar c : Col = \"#ff0000\"; // still red, but the conversion from a constant String to Int is hard-inlined using macros. Costs 0 at runtime.\nvar darker = c.toBlack(0.5); // return a 50% darker red\nvar c2 = c.to(Yellow, 0.3); // return a mix from current color with 30% of the standard yellow\n```\n\n## dn.DecisionHelper\n\nA nice tool to easily pick a value among many others using any custom criterion.\n\n```haxe\nvar arr = [ \"a\", \"foo\", \"bar\", \"food\", \"hello\" ];\n\nvar dh = new dn.DecisionHelper(arr);\n\n/* Iterates all values in arr and increase their internal score by 1 if they contain the letter \"o\". */\ndh.score( v -\u003e StringTools.contains(v,\"o\") ? 1 : 0 );\n\n/* Increase score of each values using 10% of their length (ie. longer strings get slightly higher score) */\ndh.score( v -\u003e v.length*0.1 );\n\n/* Discard any value containing the letter \"h\" */\ndh.remove( v -\u003e StringTools.contains(v,\"h\") );\n\n/* Only keep values with length\u003e1 */\ndh.keepOnly( v -\u003e v.length\u003e1 );\n\ntrace( dh.getBest() ); // -\u003e food\n/* Internal scores: a (discarded), foo (1.3), bar (0.3), food (1.4), hello (discarded). */\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepnight%2Fdeepnightlibs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepnight%2Fdeepnightlibs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepnight%2Fdeepnightlibs/lists"}