// Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/40285824): Remove this and convert code to safer constructs. #pragma allow_unsafe_buffers #endif #include "base/base64.h" #include "base/files/file_util.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "chrome/browser/new_tab_page/chrome_colors/selected_colors_info.h" #include "chrome/common/themes/autogenerated_theme_util.h" #include "skia/ext/skia_utils_base.h" // Template for color info line. // $1 - color id // $2 - red value of primary color // $3 - green value of primary color // $4 - blue value of primary color // $5 - color label id const char kColorInfoLineTemplate[] = …; // Template for the generated file content. // $1 - lines for updated color info. // $2 - number of colors. const char kFileContentTemplate[] = …; // Generates color info line in the following format: // ColorInfo(ID, SkColorSetRGB(R, G, B), LABEL, ICON_DATA) std::string GenerateColorLine(chrome_colors::ColorInfo color_info) { … } // Generates 'generated_colors_info.h' that contains selected colors from // |chrome_colors::kSelectedColorsInfo| along with generated icon data. void GenerateColorsInfoFile(std::string output_dir) { … } int main(int argc, char* argv[]) { … }