Skip to content

Commit

Permalink
docs(ui): getColorAtCoordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious authored and hipsterusername committed Oct 6, 2024
1 parent aa54c1f commit e0b6355
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,10 @@ export const getPointerType = (e: KonvaEventObject<PointerEvent>): 'mouse' | 'pe
};

/**
* Gets the color under the cursor on a Konva stage.
* @param stage The konva stage
* @returns The color under the cursor, or null if the cursor is not over the stage
* Gets the color at the given coordinate on the stage.
* @param stage The konva stage.
* @param coord The coordinate to get the color at. This must be the _absolute_ coordinate on the stage.
* @returns The color under the coordinate, or null if there was a problem getting the color.
*/
export const getColorAtCoordinate = (stage: Konva.Stage, coord: Coordinate): RgbColor | null => {
const ctx = stage
Expand Down

0 comments on commit e0b6355

Please sign in to comment.