<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def energy(self):
 """Calculate state's energy."""

        arr = self.src.copy()
        arr = self.apply_color(arr, self.state)

        scores = [histogram_distance(self.ref[i], arr[i]) for i in range(3)]

        # Important: scale by 100 for readability
        return sum(scores) * 100