MeshVS_TwoColors BindTwoColors ( const Quantity_Color& theCol1, const Quantity_Color& theCol2 )
{
MeshVS_TwoColors aRes;
-
- aRes.r1 = unsigned ( theCol1.Red() * 255.0 );
- aRes.g1 = unsigned ( theCol1.Green() * 255.0 );
- aRes.b1 = unsigned ( theCol1.Blue() * 255.0 );
- aRes.r2 = unsigned ( theCol2.Red() * 255.0 );
- aRes.g2 = unsigned ( theCol2.Green() * 255.0 );
- aRes.b2 = unsigned ( theCol2.Blue() * 255.0 );
+ NCollection_Vec3<Standard_Real> aColor_sRGB;
+ theCol1.Values (aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
+ aRes.r1 = unsigned ( aColor_sRGB.r() * 255.0 );
+ aRes.g1 = unsigned ( aColor_sRGB.g() * 255.0 );
+ aRes.b1 = unsigned ( aColor_sRGB.b() * 255.0 );
+ theCol2.Values (aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
+ aRes.r2 = unsigned ( aColor_sRGB.r() * 255.0 );
+ aRes.g2 = unsigned ( aColor_sRGB.g() * 255.0 );
+ aRes.b2 = unsigned ( aColor_sRGB.b() * 255.0 );
return aRes;
}
if ( Index == 1 )
aRes.SetValues ( Standard_Real (theTwoColors.r1) / max,
Standard_Real (theTwoColors.g1) / max,
- Standard_Real (theTwoColors.b1) / max, Quantity_TOC_RGB );
+ Standard_Real (theTwoColors.b1) / max, Quantity_TOC_sRGB );
else if (Index == 2)
aRes.SetValues ( Standard_Real (theTwoColors.r2) / max,
Standard_Real (theTwoColors.g2) / max,
- Standard_Real (theTwoColors.b2) / max, Quantity_TOC_RGB );
+ Standard_Real (theTwoColors.b2) / max, Quantity_TOC_sRGB );
return aRes;
}
Standard_Real max = 255.0;
theCol1.SetValues ( Standard_Real (theTwoColors.r1) / max,
Standard_Real (theTwoColors.g1) / max,
- Standard_Real (theTwoColors.b1) / max, Quantity_TOC_RGB );
+ Standard_Real (theTwoColors.b1) / max, Quantity_TOC_sRGB );
theCol2.SetValues ( Standard_Real (theTwoColors.r2) / max,
Standard_Real (theTwoColors.g2) / max,
- Standard_Real (theTwoColors.b2) / max, Quantity_TOC_RGB );
+ Standard_Real (theTwoColors.b2) / max, Quantity_TOC_sRGB );
}