mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0030623: Draw Harness - support hex color codes within ViewerTest::ParseColor()
ViewerTest::ParseColor() function is improved to be able to parse the following set of input arguments: - "Red Green Blue [Alpha]", where Red, Green, Blue, Alpha must be integers within the range [0, 255] or reals within the range [0.0, 1.0]. Note that "0 0 1" triple is parsed as "0.0 0.0 1.0" and will be interpreted as a blue color. - "ColorName [Alpha]", where ColorName is one of WHITE, BLACK, RED, GREEN, BLUE, etc. (look at Quantity_NameOfColor enumeration for all possible variants). Alpha may be integer or real, as described at the previous list item. - #HHH, [#]HHH[H], [#]HHHHHH[HH], where H is a hexadecimal digit (0 .. 9, a .. f, or A .. F). There are a short hexadecimal RGB, RGBA formats, and a usual RGB[A], respectively.
This commit is contained in:
@@ -73,6 +73,20 @@ public:
|
||||
v[3] = theW;
|
||||
}
|
||||
|
||||
//! Conversion constructor (explicitly converts some 4-component vector with other element type
|
||||
//! to a new 4-component vector with the element type Element_t,
|
||||
//! whose elements are static_cast'ed corresponding elements of theOtherVec4 vector)
|
||||
//! @tparam OtherElement_t the element type of the other 4-component vector theOtherVec4
|
||||
//! @param theOtherVec4 the 4-component vector that needs to be converted
|
||||
template <typename OtherElement_t>
|
||||
explicit NCollection_Vec4 (const NCollection_Vec4<OtherElement_t>& theOtherVec4)
|
||||
{
|
||||
v[0] = static_cast<Element_t> (theOtherVec4[0]);
|
||||
v[1] = static_cast<Element_t> (theOtherVec4[1]);
|
||||
v[2] = static_cast<Element_t> (theOtherVec4[2]);
|
||||
v[3] = static_cast<Element_t> (theOtherVec4[3]);
|
||||
}
|
||||
|
||||
//! Assign new values to the vector.
|
||||
void SetValues (const Element_t theX,
|
||||
const Element_t theY,
|
||||
|
Reference in New Issue
Block a user