I realize that this may not work for you in every case, but you might consider this alternative. If the only part of the button or field that is visible is text, you can use conditional formatting to change the font size to 500 to make the item disappear. This approach completely avoids the matching color challenge.
You can also put the items (any layout object you want to hide) inside a transparent portal. By manipulating a portal filter or the value of a field used in the relationship, you can control whether there is a related record displayed in the portal to make the objects appear and disappear. This method has the added advantage that the hidden buttons won't still display the hand icon when you hover the mouse over them.
Thanks Phil for the suggestion. I discovered that if I made a text box, made the text the same color as background, made the fill transparent. Then, if I made the conditional make the fill the same color as the background, the text box (which i made with a period as a handle and then dragged the box so it is as large as i need it) is invisible most of the time but when I want it to be, it is the same color as the background which effectively hides text, buttons, whatever. Have to make the button not be a hand, as you said, and also put code so that the button only does something in the desired conditions.
As far as matching colors, I discovered that when you select "any color", the strip at the bottom (which can be dragged from the center to make more boxes) is actually a palette and if you define a color at the top you can drop it into this palette. In a perfect world, if i ever change the color definition it will also change it whever i have used that option from the palette, but I haven't tested this.
The nomenclature and implementation is odd, I don't know why apple doesn't make it one of the options for palettes, perhaps because of legacy systems. But if this works as a 'user-defined color style' then that's pretty cool, too bad it's buried obscure and unintuitive.
The problem with matching the background color instead of changing the font size to 500 to make the text disappear is that future changes to the background color will require a matching update of your conditional format controlled text colors to match.
Also, while more work to set up. The portal trick allows you to have the hand feature for your button, but the hand will not appear when the button is hidden from view...