//
// University of Edinburgh brand colours
// --------------------------------------------------
//
// In compilation, the @brand-color and @brand-link-color variables are
// overridden to the values available in colour-palette.json.
//
// Values used in the colour-palette.json file have been approved for use
// in the University brand and have been tested for accessibility/contrast.
//
// Advice on what colours can be used while maintaining the University
// brand is available from Communications and Marketing.


@brand-color: #d50032;
@brand-link-color: #e4f1fe;

// Default settings for a dark brand colour.
@brand-bg-text: #fff;
@brand-as-link: @brand-color;
@brand-as-link-hover: darken(@brand-color, 5%);

// If the brand colour is light and does not have enough contrast against white,
// we override the colours to maintain contrast.
//  * White text on brand colour background becomes black.
//  * Brand colour used for a link becomes dark grey.
@brand-brightness: round(((red(@brand-color) * 299) + (green(@brand-color) * 587) + (blue(@brand-color) * 114) / 1000));
@light-color: round(((red(#ffffff) * 299) + (green(#ffffff) * 587) + (blue(#ffffff) * 114) / 1000));
& when (abs(@brand-brightness) >= (@light-color/1.4)) {
  @brand-bg-text: #000;
  @brand-as-link: @gray-dark;
  @brand-as-link-hover: #000;
}

// Deprecated @brand in favour of @brand-color.
@brand: @brand-color;
