int main(void) { short pair,f,b; initscr(); start_color(); /* Create color pairs */ init_pair(1,COLOR_WHITE,COLOR_BLUE); init_pair(2,COLOR_BLACK,COLOR_RED); init_pair(3,COLOR_YELLOW,COLOR_RED); init_pair(4,COLOR_BLUE,COLOR_GREEN); init_pair(5,COLOR_CYAN,COLOR_MAGENTA); /* display pair colors */ for(pair=1;pair<=5;pair++) { attrset(COLOR_PAIR(pair)); pair_content(pair,&f,&b); printw("Pair %d: %s foreground, %s background.\n",\ pair,ncolor(f),ncolor(b)); } refresh(); getch(); endwin(); return 0; }
virtual void drawContactPoint(const btVector3& PointOnB,const btVector3& normalOnB,btScalar distance,int lifeTime,const btVector3& color) { drawLine(PointOnB,PointOnB+normalOnB*distance,color); btVector3 ncolor(0, 0, 0); drawLine(PointOnB, PointOnB + normalOnB*0.01, ncolor); }
pngyu::PngquantOption PngyuMainWindow::make_pngquant_option( const QString &output_file_suffix ) const { // make pngquant option from current compress option pngyu::PngquantOption option; if( current_compress_option_mode() == pngyu::COMPRESS_OPTION_CUSTOM ) { option.set_ncolors( ncolor() ); if( ! output_file_suffix.isEmpty() ) { option.set_out_suffix( output_file_suffix ); } //option.set_force_overwrite( true ); option.set_speed( compress_speed() ); option.set_floyd_steinberg_dithering_disabled( ! dither_enabled() ); option.set_ie6_alpha_support( ie6_alpha_support_enabled() ); } return option; }
Resource* CreateGraphWidget( XMLIterator i, XMLCreatorEnv *env ) { XMLCreatorEnv ch_env; XMLAttributes attributes; XMLStyle branch_style; CascadeStyles( i, env, attributes, branch_style, ch_env ); std::string color = get_attribute( attributes, "color" ); NormalPixel ncolor( to_hex( color )); int dotted = 0; try_attribute_i( attributes, "dotted", &dotted ); GraphWidget *ptr = new GraphWidget( Dim2i( 100, 100 ), ncolor.c, ( dotted ? GraphWidget::GT_POINTS : GraphWidget::GT_LINES ) ); std::string bounds; if ( try_attribute( attributes, "bounds", &bounds )) { std::vector< int > b = to_integer_vector( bounds ); ptr->SetValueBounds( b[0], b[1], b[2], b[3] ); } Useless::GraphWidget::tpe_input_vector initData( 100 ); initData.resize(0); for ( double f=0.0; f <= 6.28; f += 3.14/100.0 ) { double y = sin( f ); initData.push_back( y ); } ptr->SetInputData( initData ); InsertChildWidget( ptr, attributes, env); return new AnyResource<GraphWidget*>( ptr ); }