{"action":"created","issue":{"url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2640","repository_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto","labels_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2640/labels{/name}","comments_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2640/comments","events_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2640/events","html_url":"https://github.com/gravitystorm/openstreetmap-carto/pull/2640","id":230643587,"number":2640,"title":"[Work in Progress] Render “surface” tag on roads with a pattern","user":{"login":"sommerluk","id":6830724,"avatar_url":"https://avatars0.githubusercontent.com/u/6830724?v=4","gravatar_id":"","url":"https://api.github.com/users/sommerluk","html_url":"https://github.com/sommerluk","followers_url":"https://api.github.com/users/sommerluk/followers","following_url":"https://api.github.com/users/sommerluk/following{/other_user}","gists_url":"https://api.github.com/users/sommerluk/gists{/gist_id}","starred_url":"https://api.github.com/users/sommerluk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sommerluk/subscriptions","organizations_url":"https://api.github.com/users/sommerluk/orgs","repos_url":"https://api.github.com/users/sommerluk/repos","events_url":"https://api.github.com/users/sommerluk/events{/privacy}","received_events_url":"https://api.github.com/users/sommerluk/received_events","type":"User","site_admin":false},"labels":[{"id":92407389,"url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/labels/roads","name":"roads","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":59,"created_at":"2017-05-23T09:27:40Z","updated_at":"2017-09-10T20:11:03Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/pulls/2640","html_url":"https://github.com/gravitystorm/openstreetmap-carto/pull/2640","diff_url":"https://github.com/gravitystorm/openstreetmap-carto/pull/2640.diff","patch_url":"https://github.com/gravitystorm/openstreetmap-carto/pull/2640.patch"},"body":"[Work in Progress]\r\n\r\nRender “surface” tag on roads with a pattern\r\n\r\nCloses #2621 (mutually exclusive with this PR)\r\n\r\nResolves #110 "},"comment":{"url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/comments/328368489","html_url":"https://github.com/gravitystorm/openstreetmap-carto/pull/2640#issuecomment-328368489","issue_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2640","id":328368489,"user":{"login":"imagico","id":5408119,"avatar_url":"https://avatars2.githubusercontent.com/u/5408119?v=4","gravatar_id":"","url":"https://api.github.com/users/imagico","html_url":"https://github.com/imagico","followers_url":"https://api.github.com/users/imagico/followers","following_url":"https://api.github.com/users/imagico/following{/other_user}","gists_url":"https://api.github.com/users/imagico/gists{/gist_id}","starred_url":"https://api.github.com/users/imagico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imagico/subscriptions","organizations_url":"https://api.github.com/users/imagico/orgs","repos_url":"https://api.github.com/users/imagico/repos","events_url":"https://api.github.com/users/imagico/events{/privacy}","received_events_url":"https://api.github.com/users/imagico/received_events","type":"User","site_admin":false},"created_at":"2017-09-10T20:11:03Z","updated_at":"2017-09-10T20:11:03Z","author_association":"COLLABORATOR","body":"I looked into the color adjustments for the pattern and came up with this:\r\n\r\n![road colors](http://www.imagico.de/files/roads.png)\r\n\r\nThis is based on a small tool i quickly hacked together based on lcms.  Since lcms has no python bindings this is in C: http://www.imagico.de/files/colors_bd.c.\r\n\r\nWith `echo \"#fcd6a4\" | colors_bd -40 2.6` you for example get:\r\n\r\n`#fcd6a4,#8b6c3f,#ffddab,88.02,48.02,90.62`\r\n\r\nWhich is the primary road color, as is and darkened/brightened by -40/2.6 and the corresponding lightness values.  The full list of colors with these parameters is here:\r\n\r\n```\r\nmotorway-low-zoom #e66e89,#72002b,#ee7590,61.91,21.91,64.51\r\ntrunk-low-zoom #f5977a,#80311c,#fd9e81,72.01,32.01,74.61\r\nprimary-low-zoom #f3c380,#815b1d,#fbca87,82.04,42.04,84.64\r\nsecondary-low-zoom #e8eda0,#7a803a,#f0f4a7,92.04,52.04,94.64\r\nmotorway-fill #e892a2,#772c3f,#f099a9,70.00,30.00,72.60\r\ntrunk-fill #f9b29c,#874b39,#ffb9a3,79.05,39.05,81.65\r\nprimary-fill #fcd6a4,#8b6c3f,#ffddab,88.02,48.02,90.62\r\nsecondary-fill #f7fabf,#888c57,#ffffc6,96.98,56.98,99.58\r\nplatform-fill #bbbbbb,#545454,#c2c2c2,75.88,35.88,78.48\r\naeroway-fill #bbbbcc,#545463,#c2c2d3,76.28,36.28,78.88\r\nroad-fill #dddddd,#727272,#e4e4e4,88.11,48.11,90.71\r\npedestrian-fill #dddde8,#72727c,#e4e4ef,88.36,48.36,90.96\r\nliving-street-fill #ededed,#808080,#f4f4f4,93.75,53.75,96.35\r\nraceway-fill #ffc0cb,#8e5762,#ffc7d2,83.79,43.79,86.39\r\ntrack-fill #cdbea0,#63573d,#d4c5a7,77.65,37.65,80.25\r\nresidential-fill #ffffff,#919191,#ffffff,100.00,60.00,102.60\r\n```\r\n\r\nYou can change the lightness differences of course but if the darkened version sets you at lightness below zero this will not balance of course.  If the pattern appears to have the same overall brightness as the plain color also depends on the gamma curve of your monitor of course.\r\n\r\nYou can try if this also works in python using colormath if you want to - i am just more familiar with lcms so i used this for the proof of concept.\r\n\r\nHere is the same in somewhat stronger (with -60/3.9 lightness adjustment):\r\n\r\n![road colors](http://www.imagico.de/files/roads2.png)\r\n\r\n```\r\nmotorway-low-zoom #e66e89,#3d0000,#f27993,61.91,1.91,65.81\r\ntrunk-low-zoom #f5977a,#4b0000,#ffa284,72.01,12.01,75.91\r\nprimary-low-zoom #f3c380,#4d2d00,#ffce8a,82.04,22.04,85.94\r\nsecondary-low-zoom #e8eda0,#484f07,#f3f8ab,92.04,32.04,95.94\r\nmotorway-fill #e892a2,#430015,#f39dac,70.00,10.00,73.90\r\ntrunk-fill #f9b29c,#521d0f,#ffbda6,79.05,19.05,82.95\r\nprimary-fill #fcd6a4,#573d12,#ffe1af,88.02,28.02,91.92\r\nsecondary-fill #f7fabf,#565a28,#ffffc7,96.98,36.98,100.88\r\nplatform-fill #bbbbbb,#282828,#c6c6c6,75.88,15.88,79.78\r\naeroway-fill #bbbbcc,#272835,#c6c6d7,76.28,16.28,80.18\r\nroad-fill #dddddd,#424242,#e8e8e8,88.11,28.11,92.01\r\npedestrian-fill #dddde8,#42424b,#e8e8f3,88.36,28.36,92.26\r\nliving-street-fill #ededed,#4f4f4f,#f8f8f8,93.75,33.75,97.65\r\nraceway-fill #ffc0cb,#5a2834,#ffcbd6,83.79,23.79,87.69\r\ntrack-fill #cdbea0,#342a12,#d8c9aa,77.65,17.65,81.55\r\nresidential-fill #ffffff,#5e5e5e,#ffffff,100.00,40.00,103.90\r\n```"}}
{"actor":{"display_login":"imagico"}}