DrupalSettings are not passing the values from block to js?
99 % sure it is the way your js file is set. as the above should work. for a test please do this: 

(function ($, Drupal, drupalSettings) {
  'use strict';
  Drupal.behaviors.testStuff = {
    attach: function (context) {
        alert('yes i am attached');
        console.log(drupalSettings);
        if (drupalSettings.example) {
           console.log(drupalSettings.example);
        }
    }
  };
})(jQuery, Drupal, drupalSettings);


if you don't see that in the log then try this ...

$build = [];
$build['stuff'] = [
  '#theme' =&gt; 'block--exampleblock',
  '#value' =&gt; 'test',
];
$build['#attached']['drupalSettings']['example'] =  [
        'data' =&gt; $data,
        'color'=&gt; $color,
];
$build['#attached']['library'][] = 'example/examplejs';
return $build;


remember to clear your cache too.