/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "material/scheme/scheme.h"

#include "material/palettes/core.h"

// This file is automatically generated. Do not modify it.

namespace material_color_utilities {

Scheme MaterialLightColorSchemeFromPalette(CorePalette palette) {
  Scheme scheme = {};

  scheme.primary = palette.primary().get(40);
  scheme.on_primary = palette.primary().get(100);
  scheme.primary_container = palette.primary().get(90);
  scheme.on_primary_container = palette.primary().get(10);
  scheme.secondary = palette.secondary().get(40);
  scheme.on_secondary = palette.secondary().get(100);
  scheme.secondary_container = palette.secondary().get(90);
  scheme.on_secondary_container = palette.secondary().get(10);
  scheme.tertiary = palette.tertiary().get(40);
  scheme.on_tertiary = palette.tertiary().get(100);
  scheme.tertiary_container = palette.tertiary().get(90);
  scheme.on_tertiary_container = palette.tertiary().get(10);
  scheme.error = palette.error().get(40);
  scheme.on_error = palette.error().get(100);
  scheme.error_container = palette.error().get(90);
  scheme.on_error_container = palette.error().get(10);
  scheme.background = palette.neutral().get(99);
  scheme.on_background = palette.neutral().get(10);
  scheme.surface = palette.neutral().get(99);
  scheme.on_surface = palette.neutral().get(10);
  scheme.surface_variant = palette.neutral_variant().get(90);
  scheme.on_surface_variant = palette.neutral_variant().get(30);
  scheme.outline = palette.neutral_variant().get(50);
  scheme.outline_variant = palette.neutral_variant().get(80);
  scheme.shadow = palette.neutral().get(0);
  scheme.scrim = palette.neutral().get(0);
  scheme.inverse_surface = palette.neutral().get(20);
  scheme.inverse_on_surface = palette.neutral().get(95);
  scheme.inverse_primary = palette.primary().get(80);

  return scheme;
}

Scheme MaterialDarkColorSchemeFromPalette(CorePalette palette) {
  Scheme scheme = {};

  scheme.primary = palette.primary().get(80);
  scheme.on_primary = palette.primary().get(20);
  scheme.primary_container = palette.primary().get(30);
  scheme.on_primary_container = palette.primary().get(90);
  scheme.secondary = palette.secondary().get(80);
  scheme.on_secondary = palette.secondary().get(20);
  scheme.secondary_container = palette.secondary().get(30);
  scheme.on_secondary_container = palette.secondary().get(90);
  scheme.tertiary = palette.tertiary().get(80);
  scheme.on_tertiary = palette.tertiary().get(20);
  scheme.tertiary_container = palette.tertiary().get(30);
  scheme.on_tertiary_container = palette.tertiary().get(90);
  scheme.error = palette.error().get(80);
  scheme.on_error = palette.error().get(20);
  scheme.error_container = palette.error().get(30);
  scheme.on_error_container = palette.error().get(80);
  scheme.background = palette.neutral().get(10);
  scheme.on_background = palette.neutral().get(90);
  scheme.surface = palette.neutral().get(10);
  scheme.on_surface = palette.neutral().get(90);
  scheme.surface_variant = palette.neutral_variant().get(30);
  scheme.on_surface_variant = palette.neutral_variant().get(80);
  scheme.outline = palette.neutral_variant().get(60);
  scheme.outline_variant = palette.neutral_variant().get(30);
  scheme.shadow = palette.neutral().get(0);
  scheme.scrim = palette.neutral().get(0);
  scheme.inverse_surface = palette.neutral().get(90);
  scheme.inverse_on_surface = palette.neutral().get(20);
  scheme.inverse_primary = palette.primary().get(40);

  return scheme;
}

Scheme MaterialLightColorScheme(Argb color) {
  return MaterialLightColorSchemeFromPalette(CorePalette::Of(color));
}

Scheme MaterialDarkColorScheme(Argb color) {
  return MaterialDarkColorSchemeFromPalette(CorePalette::Of(color));
}

Scheme MaterialLightContentColorScheme(Argb color) {
  return MaterialLightColorSchemeFromPalette(CorePalette::ContentOf(color));
}

Scheme MaterialDarkContentColorScheme(Argb color) {
  return MaterialDarkColorSchemeFromPalette(CorePalette::ContentOf(color));
}

}  // namespace material_color_utilities
