| 243 | } |
| 244 | |
| 245 | void 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 | |
| 256 | const std::string* Engine::GetValue( const std::string& property, Widget::PtrConst widget ) const { |
| 257 | // Look for property. |