-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathColorPicker.h
More file actions
66 lines (52 loc) · 1.56 KB
/
Copy pathColorPicker.h
File metadata and controls
66 lines (52 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
ColorPicker.h - color picker widget
Copyright (C) 2026 $_Vladislav
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#pragma once
#ifndef COLORPICKER_H
#define COLORPICKER_H
#include "BaseItem.h"
#include "ColorUtils.h"
class CMenuColorPicker : public CMenuBaseItem
{
public:
CMenuColorPicker();
virtual ~CMenuColorPicker();
void VidInit() override;
void Draw() override;
bool KeyDown( int key ) override;
bool KeyUp( int key ) override;
bool MouseMove( int x, int y ) override;
void GetRGB( byte &r, byte &g, byte &b ) const;
void SetRGB( byte r, byte g, byte b, bool rebuild = true );
float GetHue() const { return m_hue; }
float GetSat() const { return m_sat; }
float GetVal() const { return m_val; }
bool IsDragging() const { return m_draggingSV || m_draggingHue; }
void SetHSV( float h, float s, float v );
private:
float m_hue;
float m_sat;
float m_val;
Point m_svPos;
Size m_svSize;
Point m_huePos;
Size m_hueSize;
HIMAGE m_svTex;
HIMAGE m_hueTex;
HIMAGE m_cursorTex;
bool m_draggingSV;
bool m_draggingHue;
void RebuildSVTexture();
void BuildHueTexture();
void BuildCursorTexture();
};
#endif // COLORPICKER_H