# HitResult

A HitResult object contains information about the results of a hit test. It is returned by `item.hitTest(point)` and `project.hitTest(point)`.

## Properties

* `type`

  Describes the type of the hit result. For example, if you hit a segment point, the type would be `'segment'`.

  * Values:
  * `'segment'`, `'handle-in'`, `'handle-out'`, `'curve'`, `'stroke'`, `'fill'`, `'bounds'`, `'center'`, `'pixel'`
  * Type:
  * `String`
* `name`

  If the HitResult has a `hitResult.type` of `'bounds'`, this property describes which corner of the bounding rectangle was hit.

  * Values:
  * `'top-left'`, `'top-right'`, `'bottom-left'`, `'bottom-right'`, `'left-center'`, `'top-center'`, `'right-center'`, `'bottom- center'`
  * Type:
  * `String`
* `item`

  The item that was hit.

  * Type:
  * `Item`
* `location`

  If the HitResult has a type of ‘curve’ or ‘stroke’, this property gives more information about the exact position that was hit on the path.

  * Type:
  * `CurveLocation`
* `color`

  If the HitResult has a type of ‘pixel’, this property refers to the color of the pixel on the `Raster` that was hit.

  * Type:
  * `Color`⟋`null`
* `segment`

  If the HitResult has a type of ‘stroke’, ‘segment’, ‘handle-in’ or ‘handle-out’, this property refers to the segment that was hit or that is closest to the hitResult.location on the curve.

  * Type:
  * `Segment`
* `point`

  Describes the actual coordinates of the segment, handle or bounding box corner that was hit.

  * Type:
  * `Point`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://paperjs.typogram.co/project-and-items/hitresult.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
