OpenClonk
C4ConsoleQtPropListViewer.cpp File Reference
Include dependency graph for C4ConsoleQtPropListViewer.cpp:

Go to the source code of this file.

Functions

uint32_t GetTextColorForBackground (uint32_t background_color)
 

Function Documentation

◆ GetTextColorForBackground()

uint32_t GetTextColorForBackground ( uint32_t  background_color)

Definition at line 751 of file C4ConsoleQtPropListViewer.cpp.

References C4Value::_getInt(), a, StdStrBuf::Append(), StdStrBuf::AppendChar(), Application, b, C4V_Any, C4V_Array, C4V_Bool, C4V_Def, C4V_Effect, C4V_Function, C4V_Int, C4V_Nil, C4V_Object, C4V_PropList, C4V_String, C4VBool(), C4VNull, C4VObj(), C4VString(), CDT_Decide, CID_EditGraph, Config, Console, C4Object::Contained, Control, Definitions, C4Config::Developer, C4GameControl::DoInput(), C4Console::EditCursor, FormatString(), C4RefCntPointer< T >::Get(), C4DefList::GetAllDefs(), C4Value::getArray(), C4String::GetCStr(), C4EditCursor::GetCurrentSelectionPosition(), C4String::GetData(), StdStrBuf::getData(), C4Value::GetDataString(), C4Value::getDef(), C4SoundSystem::GetFirstSound(), C4PropertyPath::GetGetPath(), C4Value::getInt(), C4ValueArray::GetItem(), StdStrBuf::getLength(), C4PropList::GetName(), C4PropListStatic::GetName(), C4Value::getObj(), C4PropListStatic::GetParent(), C4PropList::GetProperty(), C4PropList::GetPropertyArray(), C4PropList::GetPropertyBool(), C4PropList::GetPropertyByS(), C4Object::GetPropertyByS(), C4PropList::GetPropertyInt(), C4PropList::GetPropertyStr(), C4Value::getPropList(), C4PropertyPath::GetRoot(), C4ValueArray::GetSize(), C4Value::getStr(), C4Value::GetType(), C4Value::GetTypeEx(), C4Object::GetX(), C4Object::GetY(), C4EditCursor::InvalidateSelection(), C4PropList::IsStatic(), LoadResStr(), LogF(), C4GUI::MouseMove(), C4SoundEffect::Next, C4PropListNumbered::Number, Objects, C4StringTable::P, P_AllowEditing, P_CanMoveCenter, P_Color, P_DefaultValueFunction, P_Delegate, P_Edges, P_EditorHelp, P_Effect, P_EmptyName, P_Filter, P_ForceSerialization, P_Group, P_Hgt, P_hgt, P_HorizontalFix, P_Name, P_OptionKey, P_Options, P_Priority, P_proplist, P_Proplist, P_ShortName, P_Sorted, P_Storage, P_StructureFix, P_Type, P_Value, P_ValueKey, P_VerticalFix, P_Vertices, P_Wdt, P_wdt, P_X, P_x, P_Y, P_y, C4Object::pEffects, C4Effect::pNext, C4StringTable::RegString(), RemoveExtension(), ControllerKeys::Right(), C4GameObjects::SafeObjectPointer(), C4Value::Set0(), C4EditCursor::SetHighlightedObject(), C4PropertyPath::SetProperty(), C4ConfigDeveloper::ShowHelp, C4Application::SoundSystem, SSearch(), StartSoundEffect(), C4PropList::Status, Strings, and C4ScriptGuiWindowPropertyName::text.

752 {
753  // White text on dark background; black text on bright background
754  uint8_t r = (background_color >> 16) & 0xff;
755  uint8_t g = (background_color >> 8) & 0xff;
756  uint8_t b = (background_color >> 0) & 0xff;
757  int32_t lgt = r * 30 + g * 59 + b * 11;
758  return (lgt > 16000) ? 0 : 0xffffff;
759 }
#define b
Here is the call graph for this function: