# Copyright (c) 2016-2025 Aeva, Inc.
# SPDX-License-Identifier: MIT
#
# The AevaScenes dataset is licensed separately under the AevaScenes Dataset License.
# See https://scenes.aeva.com/license for the full license text.

# Skip black formatting
# fmt: off

import numpy as np

plasma_color_map = [
    0x29, 0x15, 0xa9, 0x2e, 0x14, 0xa9, 0x34, 0x14, 0xa8, 0x39, 0x13, 0xa8, 0x3e, 0x13, 0xa7, 0x42,
    0x12, 0xa6, 0x47, 0x12, 0xa5, 0x4b, 0x11, 0xa4, 0x4f, 0x11, 0xa3, 0x53, 0x10, 0xa2, 0x56, 0x10,
    0xa1, 0x5a, 0x0f, 0xa0, 0x5d, 0x0e, 0x9f, 0x60, 0x0e, 0x9e, 0x63, 0x0d, 0x9d, 0x66, 0x0d, 0x9c,
    0x69, 0x0c, 0x9b, 0x6c, 0x0b, 0x9b, 0x6f, 0x0b, 0x9a, 0x71, 0x0a, 0x99, 0x74, 0x0a, 0x98, 0x76,
    0x09, 0x97, 0x79, 0x08, 0x97, 0x7b, 0x08, 0x96, 0x7d, 0x07, 0x95, 0x80, 0x07, 0x95, 0x82, 0x06,
    0x94, 0x84, 0x06, 0x93, 0x86, 0x05, 0x93, 0x88, 0x05, 0x92, 0x8b, 0x05, 0x92, 0x8d, 0x04, 0x91,
    0x8f, 0x04, 0x91, 0x91, 0x04, 0x90, 0x93, 0x03, 0x90, 0x95, 0x03, 0x8f, 0x97, 0x03, 0x8f, 0x99,
    0x02, 0x8e, 0x9b, 0x02, 0x8e, 0x9d, 0x02, 0x8d, 0x9f, 0x01, 0x8d, 0xa1, 0x01, 0x8d, 0xa2, 0x01,
    0x8c, 0xa4, 0x00, 0x8c, 0xa6, 0x00, 0x8b, 0xa8, 0x00, 0x8b, 0xaa, 0x00, 0x8a, 0xac, 0x00, 0x8a,
    0xae, 0x00, 0x89, 0xb0, 0x00, 0x89, 0xb2, 0x00, 0x88, 0xb3, 0x00, 0x88, 0xb5, 0x00, 0x87, 0xb7,
    0x00, 0x87, 0xb9, 0x00, 0x87, 0xbb, 0x00, 0x86, 0xbd, 0x00, 0x86, 0xbf, 0x00, 0x85, 0xc0, 0x00,
    0x85, 0xc2, 0x00, 0x84, 0xc4, 0x00, 0x84, 0xc6, 0x00, 0x83, 0xc8, 0x00, 0x83, 0xc9, 0x00, 0x82,
    0xcb, 0x00, 0x82, 0xcd, 0x00, 0x81, 0xcf, 0x00, 0x81, 0xd1, 0x00, 0x80, 0xd2, 0x00, 0x80, 0xd4,
    0x00, 0x7f, 0xd6, 0x00, 0x7f, 0xd8, 0x00, 0x7e, 0xd9, 0x00, 0x7e, 0xdb, 0x00, 0x7d, 0xdc, 0x00,
    0x7c, 0xde, 0x00, 0x7c, 0xe0, 0x00, 0x7b, 0xe1, 0x02, 0x7b, 0xe3, 0x04, 0x7a, 0xe4, 0x06, 0x7a,
    0xe6, 0x08, 0x79, 0xe7, 0x0a, 0x78, 0xe8, 0x0d, 0x78, 0xea, 0x0f, 0x77, 0xeb, 0x11, 0x77, 0xed,
    0x14, 0x76, 0xee, 0x16, 0x75, 0xef, 0x18, 0x75, 0xf1, 0x1a, 0x74, 0xf2, 0x1c, 0x74, 0xf3, 0x1e,
    0x73, 0xf4, 0x20, 0x72, 0xf5, 0x22, 0x72, 0xf7, 0x24, 0x71, 0xf8, 0x26, 0x70, 0xf9, 0x28, 0x70,
    0xfa, 0x2a, 0x6f, 0xfb, 0x2c, 0x6e, 0xfc, 0x2e, 0x6d, 0xfd, 0x30, 0x6d, 0xfe, 0x32, 0x6c, 0xff,
    0x34, 0x6b, 0xff, 0x36, 0x6b, 0xff, 0x38, 0x6a, 0xff, 0x3a, 0x69, 0xff, 0x3c, 0x68, 0xff, 0x3e,
    0x67, 0xff, 0x40, 0x67, 0xff, 0x42, 0x66, 0xff, 0x44, 0x65, 0xff, 0x47, 0x64, 0xff, 0x49, 0x64,
    0xff, 0x4b, 0x63, 0xff, 0x4d, 0x62, 0xff, 0x4f, 0x61, 0xff, 0x51, 0x60, 0xff, 0x53, 0x5f, 0xff,
    0x56, 0x5f, 0xff, 0x58, 0x5e, 0xff, 0x5a, 0x5d, 0xff, 0x5c, 0x5c, 0xff, 0x5e, 0x5b, 0xff, 0x60,
    0x5a, 0xff, 0x63, 0x59, 0xff, 0x65, 0x58, 0xff, 0x67, 0x57, 0xff, 0x69, 0x56, 0xff, 0x6b, 0x55,
    0xff, 0x6d, 0x54, 0xff, 0x6f, 0x53, 0xff, 0x71, 0x52, 0xff, 0x73, 0x51, 0xff, 0x75, 0x50, 0xff,
    0x77, 0x4f, 0xff, 0x79, 0x4e, 0xff, 0x7b, 0x4d, 0xff, 0x7d, 0x4c, 0xff, 0x7f, 0x4b, 0xff, 0x81,
    0x4a, 0xff, 0x83, 0x48, 0xff, 0x84, 0x47, 0xff, 0x86, 0x46, 0xff, 0x88, 0x45, 0xff, 0x8a, 0x44,
    0xff, 0x8c, 0x42, 0xff, 0x8d, 0x41, 0xff, 0x8f, 0x40, 0xff, 0x91, 0x3e, 0xff, 0x92, 0x3d, 0xff,
    0x94, 0x3c, 0xff, 0x96, 0x3a, 0xff, 0x97, 0x39, 0xff, 0x99, 0x37, 0xff, 0x9b, 0x36, 0xff, 0x9c,
    0x34, 0xff, 0x9e, 0x33, 0xff, 0xa0, 0x31, 0xff, 0xa1, 0x30, 0xff, 0xa3, 0x2e, 0xff, 0xa4, 0x2d,
    0xff, 0xa6, 0x2c, 0xff, 0xa7, 0x2b, 0xff, 0xa9, 0x2a, 0xff, 0xaa, 0x29, 0xff, 0xac, 0x28, 0xff,
    0xad, 0x27, 0xff, 0xaf, 0x26, 0xff, 0xb0, 0x25, 0xff, 0xb2, 0x24, 0xff, 0xb3, 0x24, 0xff, 0xb5,
    0x23, 0xff, 0xb6, 0x22, 0xff, 0xb7, 0x22, 0xff, 0xb9, 0x21, 0xff, 0xba, 0x20, 0xff, 0xbc, 0x20,
    0xff, 0xbd, 0x1f, 0xff, 0xbe, 0x1f, 0xff, 0xc0, 0x1f, 0xff, 0xc1, 0x1e, 0xff, 0xc2, 0x1e, 0xff,
    0xc4, 0x1d, 0xff, 0xc5, 0x1d, 0xff, 0xc7, 0x1d, 0xff, 0xc8, 0x1d, 0xff, 0xc9, 0x1c, 0xff, 0xcb,
    0x1c, 0xff, 0xcc, 0x1c, 0xff, 0xcd, 0x1c, 0xff, 0xcf, 0x1c, 0xff, 0xd0, 0x1c, 0xff, 0xd1, 0x1c,
    0xff, 0xd3, 0x1c, 0xff, 0xd4, 0x1c, 0xff, 0xd5, 0x1c, 0xff, 0xd7, 0x1c, 0xff, 0xd8, 0x1c, 0xff,
    0xd9, 0x1c, 0xff, 0xdb, 0x1c, 0xff, 0xdc, 0x1d, 0xff, 0xdd, 0x1d, 0xff, 0xde, 0x1d, 0xff, 0xe0,
    0x1d, 0xff, 0xe1, 0x1e, 0xff, 0xe2, 0x1e, 0xff, 0xe4, 0x1e, 0xff, 0xe5, 0x1f, 0xff, 0xe6, 0x1f,
    0xff, 0xe8, 0x1f, 0xff, 0xe9, 0x20, 0xff, 0xea, 0x20, 0xff, 0xec, 0x21, 0xff, 0xed, 0x21, 0xff,
    0xee, 0x22, 0xff, 0xef, 0x22, 0xff, 0xf1, 0x23]

log_plasma_color_map = [
    0x29, 0x17, 0x97, 0x29, 0x17, 0x96, 0x2e, 0x18, 0x97, 0x34, 0x1b, 0x97, 0x3a, 0x1c, 0x99, 0x41,
    0x1e, 0x9b, 0x48, 0x20, 0x9c, 0x4f, 0x21, 0x9d, 0x56, 0x21, 0x9e, 0x5c, 0x23, 0x9f, 0x64, 0x23,
    0xa0, 0x6a, 0x23, 0xa1, 0x72, 0x23, 0xa3, 0x79, 0x22, 0xa5, 0x81, 0x21, 0xa6, 0x89, 0x20, 0xa8,
    0x91, 0x1e, 0xa9, 0x98, 0x1c, 0xaa, 0x9e, 0x1a, 0xab, 0xa3, 0x18, 0xab, 0xa8, 0x18, 0xab, 0xab,
    0x17, 0xa9, 0xaf, 0x17, 0xa8, 0xb1, 0x18, 0xa7, 0xb4, 0x19, 0xa5, 0xb6, 0x19, 0xa3, 0xb9, 0x19,
    0xa2, 0xbb, 0x19, 0xa1, 0xbe, 0x18, 0xa0, 0xc0, 0x18, 0x9f, 0xc3, 0x16, 0x9d, 0xc5, 0x15, 0x9d,
    0xc7, 0x13, 0x9c, 0xca, 0x12, 0x9b, 0xcc, 0x10, 0x9a, 0xce, 0x0f, 0x99, 0xd1, 0x0f, 0x97, 0xd3,
    0x0e, 0x97, 0xd6, 0x0f, 0x95, 0xd8, 0x0f, 0x94, 0xda, 0x11, 0x92, 0xdc, 0x13, 0x90, 0xde, 0x15,
    0x8e, 0xe0, 0x16, 0x8c, 0xe1, 0x17, 0x8b, 0xe3, 0x19, 0x89, 0xe5, 0x19, 0x88, 0xe6, 0x19, 0x87,
    0xe7, 0x19, 0x86, 0xe9, 0x19, 0x84, 0xeb, 0x19, 0x83, 0xec, 0x19, 0x82, 0xed, 0x19, 0x81, 0xee,
    0x19, 0x80, 0xef, 0x1a, 0x7f, 0xf0, 0x1c, 0x7d, 0xf1, 0x1c, 0x7d, 0xf3, 0x1d, 0x7b, 0xf4, 0x1e,
    0x7a, 0xf5, 0x20, 0x79, 0xf6, 0x23, 0x78, 0xf6, 0x26, 0x77, 0xf6, 0x2a, 0x76, 0xf7, 0x2d, 0x75,
    0xf8, 0x31, 0x74, 0xf8, 0x34, 0x72, 0xf9, 0x38, 0x71, 0xf9, 0x3b, 0x70, 0xf9, 0x3d, 0x6f, 0xf9,
    0x40, 0x6e, 0xfa, 0x41, 0x6b, 0xfb, 0x44, 0x6a, 0xfc, 0x46, 0x69, 0xfc, 0x48, 0x67, 0xfc, 0x4a,
    0x66, 0xfd, 0x4c, 0x64, 0xfe, 0x4e, 0x63, 0xfe, 0x50, 0x62, 0xff, 0x52, 0x60, 0xff, 0x54, 0x5f,
    0xff, 0x56, 0x5e, 0xff, 0x59, 0x5e, 0xff, 0x5b, 0x5c, 0xff, 0x5c, 0x5b, 0xff, 0x5e, 0x5b, 0xff,
    0x60, 0x5a, 0xff, 0x62, 0x5a, 0xff, 0x64, 0x58, 0xff, 0x66, 0x58, 0xff, 0x67, 0x57, 0xff, 0x6a,
    0x57, 0xff, 0x6b, 0x56, 0xff, 0x6d, 0x56, 0xff, 0x6f, 0x55, 0xff, 0x70, 0x54, 0xff, 0x72, 0x53,
    0xff, 0x74, 0x53, 0xff, 0x75, 0x52, 0xff, 0x78, 0x51, 0xff, 0x79, 0x4f, 0xff, 0x7b, 0x4f, 0xff,
    0x7d, 0x4d, 0xff, 0x80, 0x4c, 0xff, 0x82, 0x49, 0xff, 0x85, 0x48, 0xff, 0x86, 0x47, 0xff, 0x89,
    0x46, 0xff, 0x8a, 0x44, 0xff, 0x8b, 0x44, 0xff, 0x8c, 0x42, 0xff, 0x8d, 0x42, 0xff, 0x8e, 0x41,
    0xff, 0x8f, 0x41, 0xff, 0x90, 0x40, 0xff, 0x91, 0x3f, 0xff, 0x92, 0x3f, 0xff, 0x93, 0x3e, 0xff,
    0x92, 0x3e, 0xff, 0x93, 0x3e, 0xff, 0x94, 0x3d, 0xff, 0x95, 0x3d, 0xff, 0x95, 0x3d, 0xff, 0x95,
    0x3c, 0xff, 0x96, 0x3c, 0xff, 0x97, 0x3b, 0xff, 0x97, 0x3b, 0xff, 0x98, 0x3b, 0xff, 0x98, 0x3b,
    0xff, 0x98, 0x3b, 0xff, 0x98, 0x3a, 0xff, 0x99, 0x3a, 0xff, 0x99, 0x3a, 0xff, 0x99, 0x39, 0xff,
    0x99, 0x39, 0xff, 0x9a, 0x39, 0xff, 0x9a, 0x39, 0xff, 0x9b, 0x39, 0xff, 0x9b, 0x39, 0xff, 0x9c,
    0x39, 0xff, 0x9c, 0x38, 0xff, 0x9c, 0x38, 0xff, 0x9c, 0x39, 0xff, 0x9d, 0x38, 0xff, 0x9d, 0x38,
    0xff, 0x9e, 0x38, 0xff, 0x9e, 0x38, 0xff, 0x9e, 0x37, 0xff, 0x9f, 0x37, 0xff, 0x9e, 0x38, 0xff,
    0x9f, 0x38, 0xff, 0x9f, 0x37, 0xff, 0x9f, 0x37, 0xff, 0xa0, 0x37, 0xff, 0xa0, 0x38, 0xff, 0xa1,
    0x37, 0xff, 0xa0, 0x37, 0xff, 0xa1, 0x37, 0xff, 0xa1, 0x37, 0xff, 0xa1, 0x37, 0xff, 0xa2, 0x37,
    0xff, 0xa2, 0x36, 0xff, 0xa3, 0x36, 0xff, 0xa2, 0x36, 0xff, 0xa3, 0x36, 0xff, 0xa3, 0x36, 0xff,
    0xa3, 0x36, 0xff, 0xa3, 0x36, 0xff, 0xa4, 0x36, 0xff, 0xa5, 0x35, 0xff, 0xa4, 0x35, 0xff, 0xa5,
    0x35, 0xff, 0xa5, 0x35, 0xff, 0xa5, 0x35, 0xff, 0xa6, 0x35, 0xff, 0xa6, 0x34, 0xff, 0xa7, 0x35,
    0xff, 0xa7, 0x35, 0xff, 0xa7, 0x34, 0xff, 0xa8, 0x34, 0xff, 0xa8, 0x34, 0xff, 0xa8, 0x34, 0xff,
    0xa9, 0x33, 0xff, 0xa9, 0x33, 0xff, 0xa9, 0x33, 0xff, 0xa9, 0x33, 0xff, 0xaa, 0x33, 0xff, 0xaa,
    0x32, 0xff, 0xaa, 0x32, 0xff, 0xab, 0x31, 0xff, 0xac, 0x31, 0xff, 0xac, 0x31, 0xff, 0xac, 0x31,
    0xff, 0xac, 0x30, 0xff, 0xac, 0x30, 0xff, 0xac, 0x2f, 0xff, 0xad, 0x2f, 0xff, 0xae, 0x2f, 0xff,
    0xad, 0x2f, 0xff, 0xaf, 0x2f, 0xff, 0xae, 0x2f, 0xff, 0xaf, 0x2e, 0xff, 0xaf, 0x2d, 0xff, 0xaf,
    0x2d, 0xff, 0xb0, 0x2d, 0xff, 0xb0, 0x2c, 0xff, 0xb0, 0x2d, 0xff, 0xb1, 0x2c, 0xff, 0xb1, 0x2b,
    0xff, 0xb2, 0x2b, 0xff, 0xb1, 0x2b, 0xff, 0xb2, 0x2a, 0xff, 0xb3, 0x2a, 0xff, 0xb3, 0x29, 0xff,
    0xb3, 0x29, 0xff, 0xb4, 0x28, 0xff, 0xb4, 0x29, 0xff, 0xb4, 0x28, 0xff, 0xb4, 0x28, 0xff, 0xb5,
    0x27, 0xff, 0xb5, 0x27, 0xff, 0xb5, 0x26, 0xff, 0xb6, 0x26, 0xff, 0xb6, 0x26, 0xff, 0xb6, 0x25,
    0xff, 0xb6, 0x25, 0xff, 0xb7, 0x25, 0xff, 0xb7, 0x24, 0xff, 0xb8, 0x24, 0xff, 0xb9, 0x24, 0xff,
    0xb8, 0x23, 0xff, 0xb9, 0x22, 0xff, 0xb9, 0x23, 0xff, 0xba, 0x22, 0xff, 0xba, 0x22, 0xff, 0xba,
    0x21, 0xff, 0xbb, 0x21, 0xff, 0xbb, 0x21, 0xff, 0xbc, 0x21, 0xff, 0xbc, 0x21, 0xff, 0xbc, 0x21,
    0xff, 0xbd, 0x20, 0xff, 0xbd, 0x20, 0xff, 0xbd, 0x1f, 0xff, 0xbd, 0x1f, 0xff, 0xbe, 0x1f, 0xff,
    0xbf, 0x1f, 0xff, 0xbe, 0x1f, 0xff, 0xbf, 0x1f, 0xff, 0xbf, 0x1f, 0xff, 0xbf, 0x1f, 0xff, 0xc0,
    0x1f, 0xff, 0xc0, 0x1f, 0xff, 0xc0, 0x1f, 0xff, 0xc1, 0x1f, 0xff, 0xc2, 0x1f, 0xff, 0xc1, 0x1f,
    0xff, 0xc2, 0x1f, 0xff, 0xc3, 0x1f, 0xff, 0xc3, 0x20, 0xff, 0xc3, 0x20, 0xff, 0xc3, 0x20, 0xff,
    0xc4, 0x20, 0xff, 0xc4, 0x20, 0xff, 0xc5, 0x20, 0xff, 0xc5, 0x21, 0xff, 0xc5, 0x21, 0xff, 0xc6,
    0x21, 0xff, 0xc6, 0x22, 0xff, 0xc7, 0x22, 0xff, 0xc7, 0x22, 0xff, 0xc7, 0x23, 0xff, 0xc8, 0x23,
    0xff, 0xc8, 0x23, 0xff, 0xc9, 0x24, 0xff, 0xc9, 0x25, 0xff, 0xca, 0x24, 0xff, 0xca, 0x25, 0xff,
    0xca, 0x25, 0xff, 0xcb, 0x25, 0xff, 0xcb, 0x27, 0xff, 0xcc, 0x26, 0xff, 0xcc, 0x27, 0xff, 0xcc,
    0x28, 0xff, 0xcc, 0x27, 0xff, 0xcd, 0x28, 0xff, 0xcd, 0x28, 0xff, 0xcd, 0x29, 0xff, 0xce, 0x29,
    0xff, 0xce, 0x2a, 0xff, 0xcf, 0x2a, 0xff, 0xcf, 0x2a, 0xff, 0xd0, 0x2b, 0xff, 0xd0, 0x2b, 0xff,
    0xd0, 0x2c, 0xff, 0xd1, 0x2c, 0xff, 0xd2, 0x2d, 0xff, 0xd2, 0x2c, 0xff, 0xd3, 0x2d, 0xff, 0xd2,
    0x2d, 0xff, 0xd3, 0x2e, 0xff, 0xd3, 0x2e, 0xff, 0xd4, 0x2f, 0xff, 0xd4, 0x2f, 0xff, 0xd5, 0x30,
    0xff, 0xd5, 0x2f, 0xff, 0xd6, 0x30, 0xff, 0xd5, 0x30, 0xff, 0xd6, 0x31, 0xff, 0xd7, 0x31, 0xff,
    0xd7, 0x31, 0xff, 0xd7, 0x32, 0xff, 0xd8, 0x32, 0xff, 0xd8, 0x32, 0xff, 0xd8, 0x32, 0xff, 0xd9,
    0x33, 0xff, 0xda, 0x32, 0xff, 0xda, 0x32, 0xff, 0xda, 0x33, 0xff, 0xda, 0x32, 0xff, 0xdb, 0x33,
    0xff, 0xdb, 0x33, 0xff, 0xdc, 0x33, 0xff, 0xdc, 0x33, 0xff, 0xdc, 0x33, 0xff, 0xdc, 0x33, 0xff,
    0xdd, 0x33, 0xff, 0xde, 0x33, 0xff, 0xde, 0x33, 0xff, 0xdd, 0x34, 0xff, 0xde, 0x34, 0xff, 0xdf,
    0x33, 0xff, 0xdf, 0x34, 0xff, 0xe0, 0x33, 0xff, 0xe0, 0x33, 0xff, 0xe0, 0x33, 0xff, 0xe1, 0x34,
    0xff, 0xe1, 0x34, 0xff, 0xe1, 0x34, 0xff, 0xe2, 0x33, 0xff, 0xe2, 0x34, 0xff, 0xe2, 0x34, 0xff,
    0xe3, 0x33, 0xff, 0xe2, 0x33, 0xff, 0xe3, 0x34, 0xff, 0xe4, 0x34, 0xff, 0xe4, 0x34, 0xff, 0xe5,
    0x35, 0xff, 0xe5, 0x35, 0xff, 0xe5, 0x35, 0xff, 0xe5, 0x36, 0xff, 0xe6, 0x37, 0xff, 0xe7, 0x37,
    0xff, 0xe7, 0x38, 0xff, 0xe7, 0x38, 0xff, 0xe8, 0x38, 0xff, 0xe7, 0x39, 0xff, 0xe8, 0x39, 0xff,
    0xe9, 0x3a, 0xff, 0xe9, 0x3a, 0xff, 0xe9, 0x3b, 0xff, 0xea, 0x3b, 0xff, 0xea, 0x3b, 0xff, 0xea,
    0x3c, 0xfe, 0xeb, 0x3c, 0xfe, 0xeb, 0x3d, 0xff, 0xec, 0x3d, 0xff, 0xed, 0x3e, 0xff, 0xed, 0x3e,
    0xff, 0xed, 0x3f, 0xfe, 0xee, 0x3f, 0xff, 0xee, 0x40, 0xff, 0xef, 0x40, 0xff, 0xef, 0x40, 0xff,
    0xf0, 0x42, 0xff, 0xf0, 0x44, 0xff, 0xf1, 0x47, 0xff, 0xf2, 0x4b, 0xff, 0xf3, 0x50, 0xfe, 0xf5,
    0x5e, 0xff, 0xf7, 0x69, 0xfe, 0xfa, 0x71, 0xfe, 0xfb, 0x79, 0xfe, 0xfd, 0x81, 0xfd, 0xfe, 0x80]


plasma_color_map_rgb = [tuple(plasma_color_map[i:i+3]) for i in range(0, len(plasma_color_map), 3)]
plasma_color_map_rgb_normalized = np.array(plasma_color_map_rgb) / 255.0

log_plasma_color_map_rgb = [tuple(log_plasma_color_map[i:i+3]) for i in range(0, len(log_plasma_color_map), 3)]
log_plasma_color_map_rgb_normalized = np.array(log_plasma_color_map_rgb) / 255.0
