{"id":1170,"date":"2014-05-16T17:18:18","date_gmt":"2014-05-16T15:18:18","guid":{"rendered":"http:\/\/www.jensd.de\/wordpress\/?p=1170"},"modified":"2014-05-16T17:18:18","modified_gmt":"2014-05-16T15:18:18","slug":"somehow-more-organic-how-to-create-a-noisy-gradient-in-javafx","status":"publish","type":"post","link":"https:\/\/www.jensd.de\/wordpress\/?p=1170","title":{"rendered":"&#8220;somehow more organic&#8221;: how to create a &#8216;noisy&#8217; gradient in JavaFX"},"content":{"rendered":"<p>If you always wondered why some regions on your Mac, Websites or in your Smartphone-Apps look somehow more organic than a plain coloured area or even an region with a gradient, have a closer look!<br \/>\nZooming into these areas shows that they are a bit &#8220;noisy&#8221;.<\/p>\n<p><strong>This effect can be created very easily with CSS in JavaFX too:<\/strong><br \/>\nI just noticed that &#8220;<code>-fx-background-image<\/code>&#8221; is painted in front of &#8220;<code>-fx-background-color<\/code>&#8220;:<\/p>\n<p><a href=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/javafx_css_color_paint.jpg\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1172\" data-permalink=\"https:\/\/www.jensd.de\/wordpress\/?attachment_id=1172\" data-orig-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/javafx_css_color_paint.jpg\" data-orig-size=\"508,401\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"javafx_css_color_paint\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/javafx_css_color_paint-300x236.jpg\" data-large-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/javafx_css_color_paint.jpg\" tabindex=\"0\" role=\"button\" src=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/javafx_css_color_paint.jpg\" alt=\"javafx_css_color_paint\" width=\"508\" height=\"401\" class=\"aligncenter size-full wp-image-1172\" srcset=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/javafx_css_color_paint.jpg 508w, https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/javafx_css_color_paint-300x236.jpg 300w\" sizes=\"(max-width: 508px) 100vw, 508px\" \/><\/a><\/p>\n<p>So, what is needed is a transparent &#8220;noise texture&#8221; which can be created <a href=\"http:\/\/www.cssmatic.com\/noise-texture\" title=\"http:\/\/www.cssmatic.com\/noise-texture\" target=\"_blank\">here<\/a> or <a href=\"http:\/\/www.noisetexturegenerator.com\" title=\"http:\/\/www.noisetexturegenerator.com\" target=\"_blank\">here<\/a>.<\/p>\n<p>This texture is then used as a repeated background-image and painted in front the background-color which in JavaFX-CSS can also be a linear gradient:<\/p>\n<p>[css]<br \/>\n-fx-background-color: linear-gradient(rgb(224,228,233) 0%, derive(rgb(224,228,233),-20%) 100%);<br \/>\n-fx-background-image: url(&#8220;images\/noise-texture.png&#8221;);<br \/>\n-fx-background-repeat: repeat;<br \/>\n[\/css]<\/p>\n<p>I used this approach e.g in my <a href=\"http:\/\/www.jensd.de\/wordpress\/?p=1140\" title=\"MQTT.fx 0.0.2\" target=\"_blank\">MQTT.fx<\/a>-UI:<\/p>\n<p><a href=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/mqtt-fx-6-noise-0.0.2.jpg\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1147\" data-permalink=\"https:\/\/www.jensd.de\/wordpress\/?attachment_id=1147\" data-orig-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/mqtt-fx-6-noise-0.0.2.jpg\" data-orig-size=\"600,541\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"mqtt-fx-6-noise-0.0.2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/mqtt-fx-6-noise-0.0.2-300x270.jpg\" data-large-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/mqtt-fx-6-noise-0.0.2.jpg\" tabindex=\"0\" role=\"button\" src=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/mqtt-fx-6-noise-0.0.2.jpg\" alt=\"mqtt-fx-6-noise-0.0.2\" width=\"600\" height=\"541\" class=\"aligncenter size-full wp-image-1147\" srcset=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/mqtt-fx-6-noise-0.0.2.jpg 600w, https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2014\/05\/mqtt-fx-6-noise-0.0.2-300x270.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you always wondered why some regions on your Mac, Websites or in your Smartphone-Apps look somehow more organic than a plain coloured area or even an region with a gradient, have a closer look! Zooming into these areas shows that they are a bit &#8220;noisy&#8221;. This effect can be created very easily with CSS&hellip; <span class=\"clear\"><\/span><a href=\"https:\/\/www.jensd.de\/wordpress\/?p=1170\" class=\"more-link read-more\" rel=\"bookmark\">Continue Reading <span class=\"screen-reader-text\">&#8220;somehow more organic&#8221;: how to create a &#8216;noisy&#8217; gradient in JavaFX<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"\"somehow more organic\": how to create a 'noisy' gradient in JavaFX http:\/\/wp.me\/p38FCL-iS","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[32,9,4,47],"tags":[93,80,76,103],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p38FCL-iS","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1170"}],"collection":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1170"}],"version-history":[{"count":8,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":1179,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1170\/revisions\/1179"}],"wp:attachment":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}