MCPcopy Create free account
hub / github.com/TankOs/SFGUI / ShiftBorderColors

Method ShiftBorderColors

src/SFGUI/Engine.cpp:245–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void Engine::ShiftBorderColors( sf::Color& light_color, sf::Color& dark_color, int offset ) const {
246 // TODO: Replace by += and -=. Currently not possible with SFML (see SFML issue #114).
247 light_color.r = static_cast<std::uint8_t>( std::max( 0, std::min( 255, static_cast<int>( light_color.r ) + offset ) ) );
248 light_color.g = static_cast<std::uint8_t>( std::max( 0, std::min( 255, static_cast<int>( light_color.g ) + offset ) ) );
249 light_color.b = static_cast<std::uint8_t>( std::max( 0, std::min( 255, static_cast<int>( light_color.b ) + offset ) ) );
250
251 dark_color.r = static_cast<std::uint8_t>( std::min( 255, std::max( 0, static_cast<int>( dark_color.r ) - offset ) ) );
252 dark_color.g = static_cast<std::uint8_t>( std::min( 255, std::max( 0, static_cast<int>( dark_color.g ) - offset ) ) );
253 dark_color.b = static_cast<std::uint8_t>( std::min( 255, std::max( 0, static_cast<int>( dark_color.b ) - offset ) ) );
254}
255
256const std::string* Engine::GetValue( const std::string& property, Widget::PtrConst widget ) const {
257 // Look for property.

Callers 1

CreatePaneMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected