mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
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.
24 lines
918 B
C#
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);
|
|
}
|
|
}
|
|
}
|