Logo Search packages:      
Sourcecode: opencascade version File versions  Download package

void Quantity_Color::Values ( Quantity_Parameter &  R1,
Quantity_Parameter &  R2,
Quantity_Parameter &  R3,
const Quantity_TypeOfColor  AType 
) const

Returns in R1, R2 and R3 the components of
this color according to the color system definition AType.

  • if AType is Quantity_TOC_RGB R1 is the
    quantity of red, R2 is the quantity of green and
    R3 is the quantity of blue in this color.
  • if AType is Quantity_TOC_HLS R1 is the
    hue angle in degrees (0 being red), R2 is the
    lightness and R3 is the saturation of this color.

Definition at line 359 of file Quantity_Color.cxx.

References rgbhls().

Referenced by Graphic3d_ArrayOfPrimitives::AddBound(), Graphic3d_ArrayOfPrimitives::AddVertex(), NIS_TriangulatedDrawer::BeforeDraw(), NIS_SurfaceDrawer::BeforeDraw(), Materials_Color::Color(), Materials_Color::Color255(), Aspect_ColorRampColorMap::ComputeEntry(), Graphic3d_Structure::GraphicHighlight(), Xw_Driver::InitializeColorMap(), VrmlData_Material::IsDefault(), WNT_GraphicDevice::MapColors(), Xw_Window::PixelOfColor(), Xw_ColorMap::PixelOfColor(), Graphic3d_MaterialAspect::SetAmbient(), Xw_Window::SetBackground(), Graphic3d_ArrayOfPrimitives::SetBoundColor(), WNT_GraphicDevice::SetColor(), Xw_ColorMap::SetColorOfPixel(), Xw_Window::SetCursor(), Graphic3d_MaterialAspect::SetDiffuse(), Graphic3d_Group::SetGroupPrimitivesAspect(), Xw_ColorMap::SetHighlightColor(), Graphic3d_Group::SetPrimitivesAspect(), Graphic3d_Structure::SetPrimitivesAspect(), Graphic3d_MaterialAspect::SetSpecular(), Graphic3d_ArrayOfPrimitives::SetVertexColor(), OpenGl_GraphicDriver::TriedronDisplay(), Graphic3d_GraphicDriver::TriedronDisplay(), Graphic3d_Structure::UpdateStructure(), Visual3d_Light::Visual3d_Light(), VrmlData_Material::Write(), and Graphic3d_GraphicDriver::ZBufferTriedronSetup().

                                                                                                                                           {


      switch (AType) {

            case Quantity_TOC_RGB :
                  R1    = Quantity_Parameter (MyRed);
                  R2    = Quantity_Parameter (MyGreen);
                  R3    = Quantity_Parameter (MyBlue);
            break;

            case Quantity_TOC_HLS :
                  { Standard_ShortReal MyHue, MyLight, MySaturation;

                  Quantity_Color::rgbhls
                   (MyRed, MyGreen, MyBlue, MyHue, MyLight, MySaturation);

                  R1    = Quantity_Parameter (MyHue);
                  R2    = Quantity_Parameter (MyLight);
                  R3    = Quantity_Parameter (MySaturation);
                  }
            break;
      }

}


Generated by  Doxygen 1.6.0   Back to index