{"id":18967347,"url":"https://github.com/felixdes/colsum","last_synced_at":"2025-04-19T14:33:15.126Z","repository":{"id":192907404,"uuid":"675788030","full_name":"FelixDes/colsum","owner":"FelixDes","description":"Simple cli tool for overlaying colors implemented in Kotlin","archived":false,"fork":false,"pushed_at":"2023-09-21T18:32:26.000Z","size":162,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T08:33:09.347Z","etag":null,"topics":["css3","gradle","graphics","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/FelixDes.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}},"created_at":"2023-08-07T18:13:22.000Z","updated_at":"2024-09-23T07:03:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a65025f-6a48-4d49-bf19-122e7ff66ac8","html_url":"https://github.com/FelixDes/colsum","commit_stats":null,"previous_names":["felixdes/colsum"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixDes%2Fcolsum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixDes%2Fcolsum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixDes%2Fcolsum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixDes%2Fcolsum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FelixDes","download_url":"https://codeload.github.com/FelixDes/colsum/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249213743,"owners_count":21231096,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["css3","gradle","graphics","kotlin"],"created_at":"2024-11-08T14:40:38.523Z","updated_at":"2025-04-16T07:33:44.573Z","avatar_url":"https://github.com/FelixDes.png","language":"Kotlin","readme":"\u003cdiv style=\"right:0; position: absolute; width: 100px; height: 150px; opacity: 80%\"\u003e\n    \u003cdiv style=\"position: absolute; width: 50px; height: 50px; background-color: blue; z-index: 2\"\u003e\u003c/div\u003e\n    \u003cdiv style=\"top: 30px; left: 30px; position: absolute; width: 50px; height: 50px; background-color: aqua; z-index: 1\"\u003e\u003c/div\u003e\n    \u003cdiv style=\"top: 30px; left: 30px; position: absolute; width: 50px; height: 50px; background-color: rgba(0,255,255,0.54); z-index: 3\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n# $ colsum\n\nSimple command line tool for overlaying colors implemented in Kotlin\n\n```shell\njava -jar colsum.jar -b \"lightyellow\" -e \"rgb(55, 12, 2, 0.4) + rgba(calc(0.5 + 0.5), 50, 217, 0.3)\"\n```\n\n\u003cdiv style=\"font-size: 20px\"\u003e\nUsage:\u003cbr\u003e\n    \u003cdiv style=\"margin-left: 25px\"\u003e\n    — expression, -e -\u003e Expression for computation (always required) { String }\u003cbr\u003e\n    — background, -b [#FFF] -\u003e background color { String }\u003cbr\u003e\n    — help, -h -\u003e Usage info\u003cbr\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n# Grammar\n\nGrammar of expressions (ABNF):\n\n```abnf\nroot = color [ \" + \" color ]*\n\ncolor = color-function  /  hex-color  /  named-color\n\nnamed-color = white ; https://developer.mozilla.org/en-US/docs/Web/CSS/named-color\n\ncolor-function = rgb-function  /  rgba-function  /  hsl-function  /  hsla-function\n\nrgb-function = \n  \"rgb(\" ( rgb-arg \", \" ){2} rgb-arg [ \", \" alpha-arg ] \")\"  /\n  \"rgb(\" ( rgb-arg \", \" ){2} rgb-arg [ \", \" rgb-arg ] \")\"\n\nrgba-function = \n  \"rgba(\" ( rgb-arg \", \" ){2} rgb-arg [ \", \" alpha-arg ] \")\"  /\n  \"rgba(\" ( rgb-arg \", \" ){2} rgb-arg [ \", \" rgb-arg ] \")\"\n\nhsl-function = \n  \"hsl(\" hue ( \", \" percent-or-none ){2} [ \", \" alpha-arg ] )  /\n  \"hsl(\" hue percent-or-none{2} [ \" / \" alpha-arg ] \")\"\n\nhsla-function = \n  \"hsla(\" hue ( \", \" percent-or-none ){2} [ \", \" alpha-arg ] )  /\n  \"hsla(\" hue percent-or-none{2} [ \" / \" alpha-arg ] \")\"\n\nhue = number  /  angle  /  none\n\nrgb-arg = number  /  percent-or-none\n\npercent-or-none = percent  /  none\n\nalpha-arg = percent  /  number\n\nhex-color = \n  \"#\" hex-group{3} [ hex-group ]  /\n  \"#\" HEXDIG{3} [ HEXDIG ]\n\nhex-group = HEXDIG HEXDIG\n\ncalc-function = \"calc(\" calc-sum \")\"  \n\ncalc-sum = calc-product [ [ \" + \"  /  \" - \" ] calc-product ]*  \n\ncalc-product = calc-value [ [ \" * \"  /  \" / \" ] calc-value ]*  \n\ncalc-value = \n  number            /\n  percent           /\n  calc-constant     /\n  calc-function     /\n  '(' calc-sum ')'   \n\ncalc-constant = \n  e          /\n  pi         /\n  infinity   /\n  -infinity  /\n  NaN\n  \nnumber = 1; regex: ^[+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+\\-]?\\d+)?\npercent = number \"%\"\nangle = number (\"deg\"  /  \"grad\"  /  \"turn\"  /  \"rad\")\n```\n\n# 🧑‍💻 For new contributors\n\nIf you want to improve the project follow the steps below:\n\n1. Fork the repository\n2. Create your branch from `develop`\n3. Create merge request to `develop` branch.\n4. Check that GitHub workflow completes\n\n# 🔧 Internals\n\nA brief structural components overview\n\n## 🔍️ Translator\n\nThe translator was build according to the classical 3-layer scheme: lexer, parser and executor\n1. Lexer:  \nLexer tries to apply the token patterns to the sources. If token matches the pattern (regular expression) then lexer identifies and classifies it. The result of tokenization process is the list token types and their actual string values.\n2. Parser:  \nParser builds AST from token sequence. It checks correctness of token subsequences - the way how token chains supplement each other.\n3. Executor:  \nExecutor finishes the flow with AST nodes execution. Every node is implemented as a functor that returns AST node or domain-specific data wrapper\n## 🎨 Alpha composition formulas\n\nColors are superimposed like, for example, in the Mozilla Firefox browser. Formulas are presented below:\n\n```\nresAlpha = bgAlpha + addingAlpha * (1 - bgAlpha)\nresRed = (bgRed * bgAlpha * (1 - addingAlpha) + addingRed * addingAlpha) / resAlpha\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixdes%2Fcolsum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixdes%2Fcolsum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixdes%2Fcolsum/lists"}