mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2024-12-22 06:09:48 +01:00
parent
185be7cd73
commit
17e1ebe9dc
1 changed files with 5 additions and 0 deletions
|
@ -457,6 +457,11 @@ void CHyprpicker::renderSurface(CLayerSurface* pSurface, bool forceInactive) {
|
|||
}
|
||||
|
||||
CColor CHyprpicker::getColorFromPixel(CLayerSurface* pLS, Vector2D pix) {
|
||||
pix = pix.floor();
|
||||
|
||||
if (pix.x >= pLS->screenBuffer->pixelSize.x || pix.y >= pLS->screenBuffer->pixelSize.y)
|
||||
return CColor{0, 0, 0, 0};
|
||||
|
||||
void* dataSrc = pLS->screenBuffer->paddedData ? pLS->screenBuffer->paddedData : pLS->screenBuffer->data;
|
||||
struct pixel {
|
||||
unsigned char blue;
|
||||
|
|
Loading…
Reference in a new issue