Files
PowerToys/src/modules/powerdisplay/PowerDisplay.Lib/Utils/MonitorValueConverter.cs
Yu Leng f47abb43e9 Simplify color temp display names and VCP hex parsing
Refactored color temperature display name formatting to remove
hexadecimal values from user-facing strings, returning only the
preset or custom name. Updated fallback and custom value handling
to be more concise. Replaced the TryParseHexCode helper with
direct string slicing and parsing for VCP codes. Updated
documentation comments to match new formatting. These changes
improve code clarity and provide a cleaner UI.
2025-12-12 10:59:18 +08:00

24 lines
918 B
C#

// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace PowerDisplay.Common.Utils
{
/// <summary>
/// Provides conversion utilities for monitor hardware values.
/// Use this class to convert between raw hardware values and display-friendly formats.
/// </summary>
public static class MonitorValueConverter
{
/// <summary>
/// Formats a VCP color temperature value as a display name.
/// </summary>
/// <param name="vcpValue">The VCP preset value (e.g., 0x05).</param>
/// <returns>Display name like "6500K" or "sRGB".</returns>
public static string FormatColorTemperatureDisplay(int vcpValue)
{
return ColorTemperatureHelper.FormatColorTemperatureDisplayName(vcpValue);
}
}
}