Chromium Code Reviews| Index: chrome/browser/android/vr_shell/color_scheme.cc |
| diff --git a/chrome/browser/android/vr_shell/color_scheme.cc b/chrome/browser/android/vr_shell/color_scheme.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bd7145cd983e39e3fc95795472045748851a0934 |
| --- /dev/null |
| +++ b/chrome/browser/android/vr_shell/color_scheme.cc |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/android/vr_shell/color_scheme.h" |
| + |
| +namespace vr_shell { |
| + |
| +namespace { |
| + |
| +static ColorScheme kColorSchemes[ColorScheme::kNumModes]; |
| + |
| +void InitializeColorSchemes() { |
| + static bool initialized = false; |
| + if (initialized) |
| + return; |
| + |
| + ColorScheme& normal_scheme = kColorSchemes[ColorScheme::kModeNormal]; |
| + normal_scheme.horizon = {0.89, 0.89, 0.89, 1.0}; |
| + normal_scheme.floor = {0.811, 0.811, 0.811, 1.0}; |
| + normal_scheme.ceiling = {0.859, 0.859, 0.859, 1.0}; |
| + normal_scheme.grid = {1.0, 1.0, 1.0, 1.0}; |
| + |
| + ColorScheme& fullscreen_scheme = kColorSchemes[ColorScheme::kModeFullscreen]; |
| + fullscreen_scheme.horizon = {0.039215686, 0.0, 0.082352941, 0.149019608}; |
|
acondor_
2017/05/25 15:34:40
I didn't realize this before, but why this doesn't
Ian Vollick
2017/05/25 15:54:05
I bet that this is baking in some of the alpha stu
amp
2017/05/25 15:55:30
From the chat thread, To quote. "Josh Carpenter
Tu
acondor_
2017/05/25 16:00:25
I guess it makes sense to have 0.5 for grid color,
|
| + fullscreen_scheme.floor = {0.02745098, 0.058823529, 0.109803922, 0.5}; |
| + fullscreen_scheme.ceiling = {0.015686275, 0.031372549, 0.058823529, 1.0}; |
| + fullscreen_scheme.grid = {0.639215686, 0.878431373, 1.0, 0.5}; |
| + |
| + initialized = true; |
| +} |
| + |
| +} // namespace |
| + |
| +const ColorScheme& ColorScheme::GetColorScheme(ColorScheme::Mode mode) { |
| + InitializeColorSchemes(); |
| + return kColorSchemes[static_cast<int>(mode)]; |
| +} |
| + |
| +} // namespace vr_shell |