title: Get Custom Option Values of a product magento 2
body: <p>I have two custom options for a product. Color and Size and both are dropdowns. In product detail pages, I have to display all available colors of that product.</p>
  
  <p>I tried the following code and it works. But it returns all the values of Color and Size. But I only need the color values. That is I want to select the custom options by color.</p>
  
  <pre><code>$_product = $block-&gt;getProduct();
  
  foreach($_product-&gt;getOptions() as $o){
    foreach($o-&gt;getValues() as $value){
      print_r($value-&gt;getData());
    }
  }
  </code></pre>