本文整理汇总了C++中gdk::Color::get_green_p方法的典型用法代码示例。如果您正苦于以下问题:C++ Color::get_green_p方法的具体用法?C++ Color::get_green_p怎么用?C++ Color::get_green_p使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gdk::Color
的用法示例。
在下文中一共展示了Color::get_green_p方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setColor
void GraphicalItem::setColor(const Gdk::Color& color,
const Cairo::RefPtr<Cairo::Context>& context)
{
context->set_source_rgb(color.get_red_p(),
color.get_green_p(),
color.get_blue_p());
}
示例2: setSourceRGB
void ActivityDrawingArea::setSourceRGB(Cairo::RefPtr<Cairo::Context> cr, const Gdk::Color & col) {
double r = col.get_red_p();
double g = col.get_green_p();
double b = col.get_blue_p();
//std::cout<<"ActivityDrawingArea::setSourceRGB: "<<"("<<r<<","<<g<<","<<b<<")"<<std::endl;
cr->set_source_rgb(r, g, b);
}
示例3: onWidgetExpanderBaseChanged
void WidgetExpanderBase::onWidgetExpanderBaseChanged()
{
Gdk::Color CurrentColor = mp_ColorButton->get_color();
double CurrentAlpha = mp_OpacityHScale->get_value() / 100;
int CurrentWidth = mp_WidthSpinButton->get_value();
m_signal_WidgetExpanderBaseChanged.emit(CurrentWidth,
CurrentColor.get_red_p(), CurrentColor.get_green_p(),
CurrentColor.get_blue_p(), CurrentAlpha, mp_ShowIDCheckBox->get_active()/*, mp_CheckButtonGraph->get_active()*/);
}
示例4:
static Gdk::Color
color_darken(Gdk::Color x, float amount)
{
double red = x.get_red_p() * amount;
double green = x.get_green_p() * amount;
double blue = x.get_blue_p() * amount;
x.set_rgb_p( red > 1 ? 1 : red,
green > 1 ? 1 : green,
blue > 1 ? 1 : blue);
return x;
}
示例5: get_colour_from_gui
void Settings::get_colour_from_gui (Builder &builder, int i)
{
const char *glade_name = colour_selectors[i].glade_name;
vmml::Vector4f *dest =
(vmml::Vector4f *)PTR_OFFSET(this, colour_selectors[i].member_offset);
Gdk::Color c;
Gtk::ColorButton *w = NULL;
builder->get_widget (glade_name, w);
if (!w) return;
c = w->get_color();
dest->r = c.get_red_p();
dest->g = c.get_green_p();
dest->b = c.get_blue_p();
dest->a = (float) (w->get_alpha()) / 65535.0;
m_signal_visual_settings_changed.emit();
}
示例6: drawBar
void ConnectionActivityDrawingArea::drawBar(const double x, const double y, const int overlay_count,
const Gdk::Color & colour) {
Glib::RefPtr < Gdk::Window > window = get_window();
Cairo::RefPtr < Cairo::Context > cr = window->create_cairo_context();
cr->save();
Gtk::Allocation allocation = get_allocation();
const int width = allocation.get_width();
const int height = allocation.get_height();
cr->set_line_width(2.0);
// std::cout<<"ActivityDrawingArea::drawPoints: colour: "<<"("<<main_colour[0]<<","<<main_colour[1]<<","<< main_colour[2] <<std::endl;
double r = colour.get_red_p();
double g = colour.get_green_p();
double b = colour.get_blue_p();
double step = 0.1;
//std::cout<<"ActivityDrawingArea::setSourceRGB: "<<"("<<r<<","<<g<<","<<b<<")"<<std::endl;
for (int i = overlay_count; i > 0; i--) {
if (r < 1) {
r += step;
} else if (g < 1) {
g += step;
} else if (b < 1) {
b += step;
}
}
cr->set_source_rgb(r, g, b);
double scalex = width / connection->getActivityTimer()->getStartingDelay();
//scale the drawing in x and y
cr->move_to(x * scalex, height / 2);
cr->line_to(x * scalex, y);
//std::cout << "ConnectionActivityDrawingArea::drawBar: " << "(" << x * scalex << ", " << height / 2 << ")"
// << std::endl;
cr->stroke();
cr->restore();
}
示例7: draw_activepoint_off
void CellRenderer_TimeTrack::draw_activepoint_off(
const ::Cairo::RefPtr< ::Cairo::Context>& cr,
Gdk::Color inactive_color,
int line_width,
int from_x,
int from_y,
int to_x,
int to_y)
{
std::valarray< double > activepoint_off_dashes(2);
activepoint_off_dashes[0] = 1.0;
activepoint_off_dashes[1] = 2.0;
cr->set_dash (activepoint_off_dashes, 0.0);
cr->set_source_rgb( inactive_color.get_red_p(),
inactive_color.get_green_p(),
inactive_color.get_red_p() );
cr->set_line_width(line_width);
cr->move_to(from_x, from_y);
cr->line_to(to_y, to_y);
cr->stroke();
}
示例8: convert
/// Converts a Gdk::Color to a k3d::color
const k3d::color convert(const Gdk::Color& RHS)
{
return k3d::color(RHS.get_red_p(), RHS.get_green_p(), RHS.get_blue_p());
}