本文整理汇总了C++中CColor::SetLuminance方法的典型用法代码示例。如果您正苦于以下问题:C++ CColor::SetLuminance方法的具体用法?C++ CColor::SetLuminance怎么用?C++ CColor::SetLuminance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CColor
的用法示例。
在下文中一共展示了CColor::SetLuminance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MXP_OpenAtomicTag
//.........这里部分代码省略.........
// foreground colour
strArgument = GetArgument (ArgumentList, "fore", 1, true); // get foreground colour
if (!m_bIgnoreMXPcolourChanges)
if (SetColour (strArgument, pStyle->iForeColour))
MXP_error (DBG_ERROR, errMXP_UnknownColour,
TFormat ("Unknown colour: \"%s\"" ,
(LPCTSTR) strArgument));
// background colour
strArgument = GetArgument (ArgumentList, "back", 2, true); // get background colour
if (!m_bIgnoreMXPcolourChanges)
if (SetColour (strArgument, pStyle->iBackColour))
MXP_error (DBG_ERROR, errMXP_UnknownColour,
TFormat ("Unknown colour: \"%s\"" ,
(LPCTSTR) strArgument));
}
break; // end of COLOR
case MXP_ACTION_HIGH:
{
CColor clr;
pStyle->iForeColour = colour1;
pStyle->iBackColour = colour2;
// convert to RGB colour to start with
pStyle->iFlags &= ~COLOURTYPE; // clear bits, eg. custom
pStyle->iFlags |= COLOUR_RGB;
clr.SetColor (colour1);
float lum = clr.GetLuminance ();
lum += 0.15f;
if (lum > 1.0f)
lum = 1.0f;
clr.SetLuminance (lum);
pStyle->iForeColour = clr;
}
break; // end of COLOR
case MXP_ACTION_SEND:
// send to mud hyperlink
pStyle->iFlags &= ~ACTIONTYPE; // cancel old actions
if (GetKeyword (ArgumentList, "prompt"))
pStyle->iFlags |= ACTION_PROMPT; // prompt action
else
pStyle->iFlags |= ACTION_SEND; // send-to action
if (m_bUnderlineHyperlinks)
pStyle->iFlags |= UNDERLINE; // underline it
if (m_bUseCustomLinkColour)
{
// find current background RGB value
pStyle->iForeColour = m_iHyperlinkColour; // use hyperlink colour
pStyle->iBackColour = colour2;
pStyle->iFlags &= ~COLOURTYPE; // clear bits, eg. custom
pStyle->iFlags |= COLOUR_RGB;
}
strArgument = GetArgument (ArgumentList,"href", 1, false); // get link
if (strArgument.IsEmpty ())
strArgument = GetArgument (ArgumentList,"xch_cmd", 1, false); // get link
strAction = strArgument; // hyperlink