colorAt( $image->colorspace(), $image->core()->frame($this->frame_key)->native() ); } /** * @throws GeometryException * @throws ColorException */ protected function colorAt(ColorspaceInterface $colorspace, GdImage $gd): ColorInterface { $index = @imagecolorat($gd, $this->x, $this->y); if ($index === false) { throw new GeometryException( 'The specified position is not in the valid image area.' ); } return $this->driver()->colorProcessor($colorspace)->nativeToColor($index); } }