18#include "RNA_prototypes.hh"
25#define WHEEL_SIZE (5 * U.widget_unit)
44 float softmin, softmax,
step, precision;
52 switch (
U.color_picker_type) {
69 switch (
U.color_picker_type) {
112 if (lock_luminosity) {
119 switch (
U.color_picker_type) {
221 row = &layout->
row(
false);
222 op_ptr = row->
op(
"PALETTE_OT_sort",
IFACE_(
"Saturation"), ICON_NONE);
224 row = &layout->
row(
false);
227 row = &layout->
row(
false);
228 op_ptr = row->
op(
"PALETTE_OT_sort",
IFACE_(
"Luminance"), ICON_NONE);
237 const int cols_per_row = std::max(layout->
width() /
UI_UNIT_X, 1);
257 "PALETTE_OT_color_add",
267 "PALETTE_OT_color_delete",
275 if (palette->
colors.first() !=
nullptr) {
278 "PALETTE_OT_color_move",
291 "PALETTE_OT_color_move",
307 col = &layout->
column(
true);
310 int row_cols = 0, col_id = 0;
312 if (row_cols >= cols_per_row) {
354 "UI_OT_eyedropper_color",
#define CTX_IFACE_(context, msgid)
#define BLT_I18NCONTEXT_COLOR
#define RNA_warning(format,...)
constexpr const char * c_str() const
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
Button * uiDefButR(Block *block, ButtonType type, std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, StringRefNull propname, int index, float min, float max, std::optional< StringRef > tip)
void template_color_picker(Layout *layout, PointerRNA *ptr, StringRefNull propname, bool value_slider, bool lock, bool lock_luminosity, bool cubic)
void template_palette(Layout *layout, PointerRNA *ptr, StringRefNull propname)
PointerRNA * button_operator_ptr_ensure(Button *but)
Button * uiDefIconButO(Block *block, ButtonType type, StringRefNull opname, wm::OpCallContext opcontext, int icon, int x, int y, short width, short height, std::optional< StringRef > tip)
ColorPicker * block_colorpicker_create(Block *block)
void template_crypto_picker(Layout *layout, PointerRNA *ptr, StringRefNull propname, int icon)
Button * uiDefButR_prop(Block *block, ButtonType type, std::optional< StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< StringRef > tip)
Button * uiDefIconMenuBut(Block *block, MenuCreateFunc func, void *arg, int icon, int x, int y, short width, short height, std::optional< StringRef > tip)
static void template_palette_menu(bContext *, Layout *layout, void *)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
const char * RNA_struct_identifier(const StructRNA *type)
const char * RNA_property_ui_description(const PropertyRNA *prop, const PointerRNA *ptr)
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
ListBaseT< PaletteColor > colors
float luminosity_lock_value
void label(StringRef name, int icon)
PointerRNA op(wmOperatorType *ot, std::optional< StringRef > name, int icon, wm::OpCallContext context, eUI_Item_Flag flag)
Layout & column(bool align)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)